
obj/user/faultnostack.debug:     file format elf32-i386


Disassembly of section .text:

00800020 <_start>:
// starts us running when we are initially loaded into a new environment.
.text
.globl _start
_start:
	// See if we were started with arguments on the stack
	cmpl $USTACKTOP, %esp
  800020:	81 fc 00 e0 bf ee    	cmp    $0xeebfe000,%esp
	jne args_exist
  800026:	75 04                	jne    80002c <args_exist>

	// If not, push dummy argc/argv arguments.
	// This happens when we are loaded by the kernel,
	// because the kernel does not know about passing arguments.
	pushl $0
  800028:	6a 00                	push   $0x0
	pushl $0
  80002a:	6a 00                	push   $0x0

0080002c <args_exist>:

args_exist:
	call libmain
  80002c:	e8 27 00 00 00       	call   800058 <libmain>
1:	jmp 1b
  800031:	eb fe                	jmp    800031 <args_exist+0x5>

00800033 <umain>:

void _pgfault_upcall();

void
umain(int argc, char **argv)
{
  800033:	f3 0f 1e fb          	endbr32 
  800037:	55                   	push   %ebp
  800038:	89 e5                	mov    %esp,%ebp
  80003a:	83 ec 10             	sub    $0x10,%esp
	sys_env_set_pgfault_upcall(0, (void*) _pgfault_upcall);
  80003d:	68 ab 03 80 00       	push   $0x8003ab
  800042:	6a 00                	push   $0x0
  800044:	e8 b0 02 00 00       	call   8002f9 <sys_env_set_pgfault_upcall>
	*(int*)0 = 0;
  800049:	c7 05 00 00 00 00 00 	movl   $0x0,0x0
  800050:	00 00 00 
}
  800053:	83 c4 10             	add    $0x10,%esp
  800056:	c9                   	leave  
  800057:	c3                   	ret    

00800058 <libmain>:
const volatile struct Env *thisenv;
const char *binaryname = "<unknown>";

void
libmain(int argc, char **argv)
{
  800058:	f3 0f 1e fb          	endbr32 
  80005c:	55                   	push   %ebp
  80005d:	89 e5                	mov    %esp,%ebp
  80005f:	56                   	push   %esi
  800060:	53                   	push   %ebx
  800061:	8b 5d 08             	mov    0x8(%ebp),%ebx
  800064:	8b 75 0c             	mov    0xc(%ebp),%esi
	;    //系统调用，我们已经在Exercise 7中实现了
	
	
	
	//屏幕上打印出来了字母，但后续报错了，有意思，让我看看问题出现在哪。
	thisenv=0;
  800067:	c7 05 04 40 80 00 00 	movl   $0x0,0x804004
  80006e:	00 00 00 
	thisenv = &envs[ENVX(sys_getenvid())];      //获取Env结构指针
  800071:	e8 de 00 00 00       	call   800154 <sys_getenvid>
  800076:	25 ff 03 00 00       	and    $0x3ff,%eax
  80007b:	6b c0 7c             	imul   $0x7c,%eax,%eax
  80007e:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  800083:	a3 04 40 80 00       	mov    %eax,0x804004

	// save the name of the program so that panic() can use it
	if (argc > 0)
  800088:	85 db                	test   %ebx,%ebx
  80008a:	7e 07                	jle    800093 <libmain+0x3b>
		binaryname = argv[0];
  80008c:	8b 06                	mov    (%esi),%eax
  80008e:	a3 00 30 80 00       	mov    %eax,0x803000

	// call user main routine
	umain(argc, argv);
  800093:	83 ec 08             	sub    $0x8,%esp
  800096:	56                   	push   %esi
  800097:	53                   	push   %ebx
  800098:	e8 96 ff ff ff       	call   800033 <umain>

	// exit gracefully
	exit();
  80009d:	e8 0a 00 00 00       	call   8000ac <exit>
}
  8000a2:	83 c4 10             	add    $0x10,%esp
  8000a5:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8000a8:	5b                   	pop    %ebx
  8000a9:	5e                   	pop    %esi
  8000aa:	5d                   	pop    %ebp
  8000ab:	c3                   	ret    

008000ac <exit>:

#include <inc/lib.h>

void
exit(void)
{
  8000ac:	f3 0f 1e fb          	endbr32 
  8000b0:	55                   	push   %ebp
  8000b1:	89 e5                	mov    %esp,%ebp
  8000b3:	83 ec 08             	sub    $0x8,%esp
	close_all();
  8000b6:	e8 06 05 00 00       	call   8005c1 <close_all>
	sys_env_destroy(0);
  8000bb:	83 ec 0c             	sub    $0xc,%esp
  8000be:	6a 00                	push   $0x0
  8000c0:	e8 4a 00 00 00       	call   80010f <sys_env_destroy>
}
  8000c5:	83 c4 10             	add    $0x10,%esp
  8000c8:	c9                   	leave  
  8000c9:	c3                   	ret    

008000ca <sys_cputs>:
	return ret;
}

void
sys_cputs(const char *s, size_t len)
{
  8000ca:	f3 0f 1e fb          	endbr32 
  8000ce:	55                   	push   %ebp
  8000cf:	89 e5                	mov    %esp,%ebp
  8000d1:	57                   	push   %edi
  8000d2:	56                   	push   %esi
  8000d3:	53                   	push   %ebx
	asm volatile("int %1\n"
  8000d4:	b8 00 00 00 00       	mov    $0x0,%eax
  8000d9:	8b 55 08             	mov    0x8(%ebp),%edx
  8000dc:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8000df:	89 c3                	mov    %eax,%ebx
  8000e1:	89 c7                	mov    %eax,%edi
  8000e3:	89 c6                	mov    %eax,%esi
  8000e5:	cd 30                	int    $0x30
	syscall(SYS_cputs, 0, (uint32_t)s, len, 0, 0, 0);
}
  8000e7:	5b                   	pop    %ebx
  8000e8:	5e                   	pop    %esi
  8000e9:	5f                   	pop    %edi
  8000ea:	5d                   	pop    %ebp
  8000eb:	c3                   	ret    

008000ec <sys_cgetc>:

int
sys_cgetc(void)
{
  8000ec:	f3 0f 1e fb          	endbr32 
  8000f0:	55                   	push   %ebp
  8000f1:	89 e5                	mov    %esp,%ebp
  8000f3:	57                   	push   %edi
  8000f4:	56                   	push   %esi
  8000f5:	53                   	push   %ebx
	asm volatile("int %1\n"
  8000f6:	ba 00 00 00 00       	mov    $0x0,%edx
  8000fb:	b8 01 00 00 00       	mov    $0x1,%eax
  800100:	89 d1                	mov    %edx,%ecx
  800102:	89 d3                	mov    %edx,%ebx
  800104:	89 d7                	mov    %edx,%edi
  800106:	89 d6                	mov    %edx,%esi
  800108:	cd 30                	int    $0x30
	return syscall(SYS_cgetc, 0, 0, 0, 0, 0, 0);
}
  80010a:	5b                   	pop    %ebx
  80010b:	5e                   	pop    %esi
  80010c:	5f                   	pop    %edi
  80010d:	5d                   	pop    %ebp
  80010e:	c3                   	ret    

0080010f <sys_env_destroy>:

int
sys_env_destroy(envid_t envid)
{
  80010f:	f3 0f 1e fb          	endbr32 
  800113:	55                   	push   %ebp
  800114:	89 e5                	mov    %esp,%ebp
  800116:	57                   	push   %edi
  800117:	56                   	push   %esi
  800118:	53                   	push   %ebx
  800119:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  80011c:	b9 00 00 00 00       	mov    $0x0,%ecx
  800121:	8b 55 08             	mov    0x8(%ebp),%edx
  800124:	b8 03 00 00 00       	mov    $0x3,%eax
  800129:	89 cb                	mov    %ecx,%ebx
  80012b:	89 cf                	mov    %ecx,%edi
  80012d:	89 ce                	mov    %ecx,%esi
  80012f:	cd 30                	int    $0x30
	if(check && ret > 0)
  800131:	85 c0                	test   %eax,%eax
  800133:	7f 08                	jg     80013d <sys_env_destroy+0x2e>
	return syscall(SYS_env_destroy, 1, envid, 0, 0, 0, 0);
}
  800135:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800138:	5b                   	pop    %ebx
  800139:	5e                   	pop    %esi
  80013a:	5f                   	pop    %edi
  80013b:	5d                   	pop    %ebp
  80013c:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  80013d:	83 ec 0c             	sub    $0xc,%esp
  800140:	50                   	push   %eax
  800141:	6a 03                	push   $0x3
  800143:	68 8a 1f 80 00       	push   $0x801f8a
  800148:	6a 23                	push   $0x23
  80014a:	68 a7 1f 80 00       	push   $0x801fa7
  80014f:	e8 c3 0f 00 00       	call   801117 <_panic>

00800154 <sys_getenvid>:

envid_t
sys_getenvid(void)
{
  800154:	f3 0f 1e fb          	endbr32 
  800158:	55                   	push   %ebp
  800159:	89 e5                	mov    %esp,%ebp
  80015b:	57                   	push   %edi
  80015c:	56                   	push   %esi
  80015d:	53                   	push   %ebx
	asm volatile("int %1\n"
  80015e:	ba 00 00 00 00       	mov    $0x0,%edx
  800163:	b8 02 00 00 00       	mov    $0x2,%eax
  800168:	89 d1                	mov    %edx,%ecx
  80016a:	89 d3                	mov    %edx,%ebx
  80016c:	89 d7                	mov    %edx,%edi
  80016e:	89 d6                	mov    %edx,%esi
  800170:	cd 30                	int    $0x30
	 return syscall(SYS_getenvid, 0, 0, 0, 0, 0, 0);
}
  800172:	5b                   	pop    %ebx
  800173:	5e                   	pop    %esi
  800174:	5f                   	pop    %edi
  800175:	5d                   	pop    %ebp
  800176:	c3                   	ret    

00800177 <sys_yield>:

void
sys_yield(void)
{
  800177:	f3 0f 1e fb          	endbr32 
  80017b:	55                   	push   %ebp
  80017c:	89 e5                	mov    %esp,%ebp
  80017e:	57                   	push   %edi
  80017f:	56                   	push   %esi
  800180:	53                   	push   %ebx
	asm volatile("int %1\n"
  800181:	ba 00 00 00 00       	mov    $0x0,%edx
  800186:	b8 0b 00 00 00       	mov    $0xb,%eax
  80018b:	89 d1                	mov    %edx,%ecx
  80018d:	89 d3                	mov    %edx,%ebx
  80018f:	89 d7                	mov    %edx,%edi
  800191:	89 d6                	mov    %edx,%esi
  800193:	cd 30                	int    $0x30
	syscall(SYS_yield, 0, 0, 0, 0, 0, 0);
}
  800195:	5b                   	pop    %ebx
  800196:	5e                   	pop    %esi
  800197:	5f                   	pop    %edi
  800198:	5d                   	pop    %ebp
  800199:	c3                   	ret    

0080019a <sys_page_alloc>:

int
sys_page_alloc(envid_t envid, void *va, int perm)
{
  80019a:	f3 0f 1e fb          	endbr32 
  80019e:	55                   	push   %ebp
  80019f:	89 e5                	mov    %esp,%ebp
  8001a1:	57                   	push   %edi
  8001a2:	56                   	push   %esi
  8001a3:	53                   	push   %ebx
  8001a4:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  8001a7:	be 00 00 00 00       	mov    $0x0,%esi
  8001ac:	8b 55 08             	mov    0x8(%ebp),%edx
  8001af:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8001b2:	b8 04 00 00 00       	mov    $0x4,%eax
  8001b7:	8b 5d 10             	mov    0x10(%ebp),%ebx
  8001ba:	89 f7                	mov    %esi,%edi
  8001bc:	cd 30                	int    $0x30
	if(check && ret > 0)
  8001be:	85 c0                	test   %eax,%eax
  8001c0:	7f 08                	jg     8001ca <sys_page_alloc+0x30>
	return syscall(SYS_page_alloc, 1, envid, (uint32_t) va, perm, 0, 0);
}
  8001c2:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8001c5:	5b                   	pop    %ebx
  8001c6:	5e                   	pop    %esi
  8001c7:	5f                   	pop    %edi
  8001c8:	5d                   	pop    %ebp
  8001c9:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  8001ca:	83 ec 0c             	sub    $0xc,%esp
  8001cd:	50                   	push   %eax
  8001ce:	6a 04                	push   $0x4
  8001d0:	68 8a 1f 80 00       	push   $0x801f8a
  8001d5:	6a 23                	push   $0x23
  8001d7:	68 a7 1f 80 00       	push   $0x801fa7
  8001dc:	e8 36 0f 00 00       	call   801117 <_panic>

008001e1 <sys_page_map>:

int
sys_page_map(envid_t srcenv, void *srcva, envid_t dstenv, void *dstva, int perm)
{
  8001e1:	f3 0f 1e fb          	endbr32 
  8001e5:	55                   	push   %ebp
  8001e6:	89 e5                	mov    %esp,%ebp
  8001e8:	57                   	push   %edi
  8001e9:	56                   	push   %esi
  8001ea:	53                   	push   %ebx
  8001eb:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  8001ee:	8b 55 08             	mov    0x8(%ebp),%edx
  8001f1:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8001f4:	b8 05 00 00 00       	mov    $0x5,%eax
  8001f9:	8b 5d 10             	mov    0x10(%ebp),%ebx
  8001fc:	8b 7d 14             	mov    0x14(%ebp),%edi
  8001ff:	8b 75 18             	mov    0x18(%ebp),%esi
  800202:	cd 30                	int    $0x30
	if(check && ret > 0)
  800204:	85 c0                	test   %eax,%eax
  800206:	7f 08                	jg     800210 <sys_page_map+0x2f>
	return syscall(SYS_page_map, 1, srcenv, (uint32_t) srcva, dstenv, (uint32_t) dstva, perm);
}
  800208:	8d 65 f4             	lea    -0xc(%ebp),%esp
  80020b:	5b                   	pop    %ebx
  80020c:	5e                   	pop    %esi
  80020d:	5f                   	pop    %edi
  80020e:	5d                   	pop    %ebp
  80020f:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800210:	83 ec 0c             	sub    $0xc,%esp
  800213:	50                   	push   %eax
  800214:	6a 05                	push   $0x5
  800216:	68 8a 1f 80 00       	push   $0x801f8a
  80021b:	6a 23                	push   $0x23
  80021d:	68 a7 1f 80 00       	push   $0x801fa7
  800222:	e8 f0 0e 00 00       	call   801117 <_panic>

00800227 <sys_page_unmap>:

int
sys_page_unmap(envid_t envid, void *va)
{
  800227:	f3 0f 1e fb          	endbr32 
  80022b:	55                   	push   %ebp
  80022c:	89 e5                	mov    %esp,%ebp
  80022e:	57                   	push   %edi
  80022f:	56                   	push   %esi
  800230:	53                   	push   %ebx
  800231:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800234:	bb 00 00 00 00       	mov    $0x0,%ebx
  800239:	8b 55 08             	mov    0x8(%ebp),%edx
  80023c:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  80023f:	b8 06 00 00 00       	mov    $0x6,%eax
  800244:	89 df                	mov    %ebx,%edi
  800246:	89 de                	mov    %ebx,%esi
  800248:	cd 30                	int    $0x30
	if(check && ret > 0)
  80024a:	85 c0                	test   %eax,%eax
  80024c:	7f 08                	jg     800256 <sys_page_unmap+0x2f>
	return syscall(SYS_page_unmap, 1, envid, (uint32_t) va, 0, 0, 0);
}
  80024e:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800251:	5b                   	pop    %ebx
  800252:	5e                   	pop    %esi
  800253:	5f                   	pop    %edi
  800254:	5d                   	pop    %ebp
  800255:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800256:	83 ec 0c             	sub    $0xc,%esp
  800259:	50                   	push   %eax
  80025a:	6a 06                	push   $0x6
  80025c:	68 8a 1f 80 00       	push   $0x801f8a
  800261:	6a 23                	push   $0x23
  800263:	68 a7 1f 80 00       	push   $0x801fa7
  800268:	e8 aa 0e 00 00       	call   801117 <_panic>

0080026d <sys_env_set_status>:

// sys_exofork is inlined in lib.h

int
sys_env_set_status(envid_t envid, int status)
{
  80026d:	f3 0f 1e fb          	endbr32 
  800271:	55                   	push   %ebp
  800272:	89 e5                	mov    %esp,%ebp
  800274:	57                   	push   %edi
  800275:	56                   	push   %esi
  800276:	53                   	push   %ebx
  800277:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  80027a:	bb 00 00 00 00       	mov    $0x0,%ebx
  80027f:	8b 55 08             	mov    0x8(%ebp),%edx
  800282:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800285:	b8 08 00 00 00       	mov    $0x8,%eax
  80028a:	89 df                	mov    %ebx,%edi
  80028c:	89 de                	mov    %ebx,%esi
  80028e:	cd 30                	int    $0x30
	if(check && ret > 0)
  800290:	85 c0                	test   %eax,%eax
  800292:	7f 08                	jg     80029c <sys_env_set_status+0x2f>
	return syscall(SYS_env_set_status, 1, envid, status, 0, 0, 0);
}
  800294:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800297:	5b                   	pop    %ebx
  800298:	5e                   	pop    %esi
  800299:	5f                   	pop    %edi
  80029a:	5d                   	pop    %ebp
  80029b:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  80029c:	83 ec 0c             	sub    $0xc,%esp
  80029f:	50                   	push   %eax
  8002a0:	6a 08                	push   $0x8
  8002a2:	68 8a 1f 80 00       	push   $0x801f8a
  8002a7:	6a 23                	push   $0x23
  8002a9:	68 a7 1f 80 00       	push   $0x801fa7
  8002ae:	e8 64 0e 00 00       	call   801117 <_panic>

008002b3 <sys_env_set_trapframe>:

int
sys_env_set_trapframe(envid_t envid, struct Trapframe *tf)
{
  8002b3:	f3 0f 1e fb          	endbr32 
  8002b7:	55                   	push   %ebp
  8002b8:	89 e5                	mov    %esp,%ebp
  8002ba:	57                   	push   %edi
  8002bb:	56                   	push   %esi
  8002bc:	53                   	push   %ebx
  8002bd:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  8002c0:	bb 00 00 00 00       	mov    $0x0,%ebx
  8002c5:	8b 55 08             	mov    0x8(%ebp),%edx
  8002c8:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8002cb:	b8 09 00 00 00       	mov    $0x9,%eax
  8002d0:	89 df                	mov    %ebx,%edi
  8002d2:	89 de                	mov    %ebx,%esi
  8002d4:	cd 30                	int    $0x30
	if(check && ret > 0)
  8002d6:	85 c0                	test   %eax,%eax
  8002d8:	7f 08                	jg     8002e2 <sys_env_set_trapframe+0x2f>
	return syscall(SYS_env_set_trapframe, 1, envid, (uint32_t) tf, 0, 0, 0);
}
  8002da:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8002dd:	5b                   	pop    %ebx
  8002de:	5e                   	pop    %esi
  8002df:	5f                   	pop    %edi
  8002e0:	5d                   	pop    %ebp
  8002e1:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  8002e2:	83 ec 0c             	sub    $0xc,%esp
  8002e5:	50                   	push   %eax
  8002e6:	6a 09                	push   $0x9
  8002e8:	68 8a 1f 80 00       	push   $0x801f8a
  8002ed:	6a 23                	push   $0x23
  8002ef:	68 a7 1f 80 00       	push   $0x801fa7
  8002f4:	e8 1e 0e 00 00       	call   801117 <_panic>

008002f9 <sys_env_set_pgfault_upcall>:

int
sys_env_set_pgfault_upcall(envid_t envid, void *upcall)
{
  8002f9:	f3 0f 1e fb          	endbr32 
  8002fd:	55                   	push   %ebp
  8002fe:	89 e5                	mov    %esp,%ebp
  800300:	57                   	push   %edi
  800301:	56                   	push   %esi
  800302:	53                   	push   %ebx
  800303:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800306:	bb 00 00 00 00       	mov    $0x0,%ebx
  80030b:	8b 55 08             	mov    0x8(%ebp),%edx
  80030e:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800311:	b8 0a 00 00 00       	mov    $0xa,%eax
  800316:	89 df                	mov    %ebx,%edi
  800318:	89 de                	mov    %ebx,%esi
  80031a:	cd 30                	int    $0x30
	if(check && ret > 0)
  80031c:	85 c0                	test   %eax,%eax
  80031e:	7f 08                	jg     800328 <sys_env_set_pgfault_upcall+0x2f>
	return syscall(SYS_env_set_pgfault_upcall, 1, envid, (uint32_t) upcall, 0, 0, 0);
}
  800320:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800323:	5b                   	pop    %ebx
  800324:	5e                   	pop    %esi
  800325:	5f                   	pop    %edi
  800326:	5d                   	pop    %ebp
  800327:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800328:	83 ec 0c             	sub    $0xc,%esp
  80032b:	50                   	push   %eax
  80032c:	6a 0a                	push   $0xa
  80032e:	68 8a 1f 80 00       	push   $0x801f8a
  800333:	6a 23                	push   $0x23
  800335:	68 a7 1f 80 00       	push   $0x801fa7
  80033a:	e8 d8 0d 00 00       	call   801117 <_panic>

0080033f <sys_ipc_try_send>:

int
sys_ipc_try_send(envid_t envid, uint32_t value, void *srcva, int perm)
{
  80033f:	f3 0f 1e fb          	endbr32 
  800343:	55                   	push   %ebp
  800344:	89 e5                	mov    %esp,%ebp
  800346:	57                   	push   %edi
  800347:	56                   	push   %esi
  800348:	53                   	push   %ebx
	asm volatile("int %1\n"
  800349:	8b 55 08             	mov    0x8(%ebp),%edx
  80034c:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  80034f:	b8 0c 00 00 00       	mov    $0xc,%eax
  800354:	be 00 00 00 00       	mov    $0x0,%esi
  800359:	8b 5d 10             	mov    0x10(%ebp),%ebx
  80035c:	8b 7d 14             	mov    0x14(%ebp),%edi
  80035f:	cd 30                	int    $0x30
	return syscall(SYS_ipc_try_send, 0, envid, value, (uint32_t) srcva, perm, 0);
}
  800361:	5b                   	pop    %ebx
  800362:	5e                   	pop    %esi
  800363:	5f                   	pop    %edi
  800364:	5d                   	pop    %ebp
  800365:	c3                   	ret    

00800366 <sys_ipc_recv>:

int
sys_ipc_recv(void *dstva)
{
  800366:	f3 0f 1e fb          	endbr32 
  80036a:	55                   	push   %ebp
  80036b:	89 e5                	mov    %esp,%ebp
  80036d:	57                   	push   %edi
  80036e:	56                   	push   %esi
  80036f:	53                   	push   %ebx
  800370:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800373:	b9 00 00 00 00       	mov    $0x0,%ecx
  800378:	8b 55 08             	mov    0x8(%ebp),%edx
  80037b:	b8 0d 00 00 00       	mov    $0xd,%eax
  800380:	89 cb                	mov    %ecx,%ebx
  800382:	89 cf                	mov    %ecx,%edi
  800384:	89 ce                	mov    %ecx,%esi
  800386:	cd 30                	int    $0x30
	if(check && ret > 0)
  800388:	85 c0                	test   %eax,%eax
  80038a:	7f 08                	jg     800394 <sys_ipc_recv+0x2e>
	return syscall(SYS_ipc_recv, 1, (uint32_t)dstva, 0, 0, 0, 0);
}
  80038c:	8d 65 f4             	lea    -0xc(%ebp),%esp
  80038f:	5b                   	pop    %ebx
  800390:	5e                   	pop    %esi
  800391:	5f                   	pop    %edi
  800392:	5d                   	pop    %ebp
  800393:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800394:	83 ec 0c             	sub    $0xc,%esp
  800397:	50                   	push   %eax
  800398:	6a 0d                	push   $0xd
  80039a:	68 8a 1f 80 00       	push   $0x801f8a
  80039f:	6a 23                	push   $0x23
  8003a1:	68 a7 1f 80 00       	push   $0x801fa7
  8003a6:	e8 6c 0d 00 00       	call   801117 <_panic>

008003ab <_pgfault_upcall>:

.text
.globl _pgfault_upcall
_pgfault_upcall:
	// Call the C page fault handler.
	pushl %esp			// function argument: pointer to UTF
  8003ab:	54                   	push   %esp
	movl _pgfault_handler, %eax
  8003ac:	a1 00 60 80 00       	mov    0x806000,%eax
	call *%eax
  8003b1:	ff d0                	call   *%eax
	addl $4, %esp			// pop function argument
  8003b3:	83 c4 04             	add    $0x4,%esp
	// may find that you have to rearrange your code in non-obvious
	// ways as registers become unavailable as scratch space.
	//
	// LAB 4: Your code here.
	//首先把此时的eip指针下移48个字节因为UTrapFrame的大小是48个字节
	movl 48(%esp), %ebp
  8003b6:	8b 6c 24 30          	mov    0x30(%esp),%ebp
    subl $4, %ebp		// UTrapFrame.utf_esp - 4 and store back 这里是由于之前预留了4个字节。
  8003ba:	83 ed 04             	sub    $0x4,%ebp
    movl %ebp, 48(%esp)	// 返回上一次的esp位置。
  8003bd:	89 6c 24 30          	mov    %ebp,0x30(%esp)

	// Restore the trap-time registers.  After you do this, you
	// can no longer modify any general-purpose registers.
	// LAB 4: Your code here.
	movl 40(%esp), %eax 
  8003c1:	8b 44 24 28          	mov    0x28(%esp),%eax
    movl %eax, (%ebp)
  8003c5:	89 45 00             	mov    %eax,0x0(%ebp)

	// Restore eflags from the stack.  After you do this, you can
	// no longer use arithmetic operations or anything else that
	// modifies eflags.
	// LAB 4: Your code here.
	addl $0x8, %esp         // Set %esp to the end of struct PushRegs
  8003c8:	83 c4 08             	add    $0x8,%esp
	popal                   // Restore the trap-time registers.(struct PushRegs)
  8003cb:	61                   	popa   

	// Switch back to the adjusted trap-time stack.
	// LAB 4: Your code here.
	addl $0x4, %esp         // now we are located at trap-time eip,so we have to increment %esp with 4.【跳过eip】
  8003cc:	83 c4 04             	add    $0x4,%esp
	popfl                   // Restore eflags register.	【pop eflags】
  8003cf:	9d                   	popf   
	popl %esp               // Just restore the adjusted trap-time stack pointer.
  8003d0:	5c                   	pop    %esp
							// 恢复esp

	// Return to re-execute the instruction that faulted.
	// LAB 4: Your code here.
	ret                     // We are now on the trap-time stack,since we have saved trap-time eip above trap-time esp,ret instruction will pop this trap-time eip to register %eip which known as PC at this time.Thus,we can return to re-execute the instruction that faulted.
  8003d1:	c3                   	ret    

008003d2 <fd2num>:
// File descriptor manipulators
// --------------------------------------------------------------

int
fd2num(struct Fd *fd)
{
  8003d2:	f3 0f 1e fb          	endbr32 
  8003d6:	55                   	push   %ebp
  8003d7:	89 e5                	mov    %esp,%ebp
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  8003d9:	8b 45 08             	mov    0x8(%ebp),%eax
  8003dc:	05 00 00 00 30       	add    $0x30000000,%eax
  8003e1:	c1 e8 0c             	shr    $0xc,%eax
}
  8003e4:	5d                   	pop    %ebp
  8003e5:	c3                   	ret    

008003e6 <fd2data>:

char*
fd2data(struct Fd *fd)
{
  8003e6:	f3 0f 1e fb          	endbr32 
  8003ea:	55                   	push   %ebp
  8003eb:	89 e5                	mov    %esp,%ebp
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  8003ed:	8b 45 08             	mov    0x8(%ebp),%eax
  8003f0:	05 00 00 00 30       	add    $0x30000000,%eax
	return INDEX2DATA(fd2num(fd));
  8003f5:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  8003fa:	2d 00 00 fe 2f       	sub    $0x2ffe0000,%eax
}
  8003ff:	5d                   	pop    %ebp
  800400:	c3                   	ret    

00800401 <fd_alloc>:
// Returns 0 on success, < 0 on error.  Errors are:
//	-E_MAX_FD: no more file descriptors
// On error, *fd_store is set to 0.
int
fd_alloc(struct Fd **fd_store)
{
  800401:	f3 0f 1e fb          	endbr32 
  800405:	55                   	push   %ebp
  800406:	89 e5                	mov    %esp,%ebp
  800408:	b8 00 00 00 d0       	mov    $0xd0000000,%eax
	int i;
	struct Fd *fd;

	for (i = 0; i < MAXFD; i++) {
		fd = INDEX2FD(i);
		if ((uvpd[PDX(fd)] & PTE_P) == 0 || (uvpt[PGNUM(fd)] & PTE_P) == 0) {
  80040d:	89 c2                	mov    %eax,%edx
  80040f:	c1 ea 16             	shr    $0x16,%edx
  800412:	8b 14 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%edx
  800419:	f6 c2 01             	test   $0x1,%dl
  80041c:	74 2d                	je     80044b <fd_alloc+0x4a>
  80041e:	89 c2                	mov    %eax,%edx
  800420:	c1 ea 0c             	shr    $0xc,%edx
  800423:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  80042a:	f6 c2 01             	test   $0x1,%dl
  80042d:	74 1c                	je     80044b <fd_alloc+0x4a>
  80042f:	05 00 10 00 00       	add    $0x1000,%eax
	for (i = 0; i < MAXFD; i++) {
  800434:	3d 00 00 02 d0       	cmp    $0xd0020000,%eax
  800439:	75 d2                	jne    80040d <fd_alloc+0xc>
			*fd_store = fd;
			return 0;
		}
	}
	*fd_store = 0;
  80043b:	8b 45 08             	mov    0x8(%ebp),%eax
  80043e:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	return -E_MAX_OPEN;
  800444:	b8 f6 ff ff ff       	mov    $0xfffffff6,%eax
  800449:	eb 0a                	jmp    800455 <fd_alloc+0x54>
			*fd_store = fd;
  80044b:	8b 4d 08             	mov    0x8(%ebp),%ecx
  80044e:	89 01                	mov    %eax,(%ecx)
			return 0;
  800450:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800455:	5d                   	pop    %ebp
  800456:	c3                   	ret    

00800457 <fd_lookup>:
// Returns 0 on success (the page is in range and mapped), < 0 on error.
// Errors are:
//	-E_INVAL: fdnum was either not in range or not mapped.
int
fd_lookup(int fdnum, struct Fd **fd_store)
{
  800457:	f3 0f 1e fb          	endbr32 
  80045b:	55                   	push   %ebp
  80045c:	89 e5                	mov    %esp,%ebp
  80045e:	8b 45 08             	mov    0x8(%ebp),%eax
	struct Fd *fd;

	if (fdnum < 0 || fdnum >= MAXFD) {
  800461:	83 f8 1f             	cmp    $0x1f,%eax
  800464:	77 30                	ja     800496 <fd_lookup+0x3f>
		if (debug)
			cprintf("[%08x] bad fd %d\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	fd = INDEX2FD(fdnum);
  800466:	c1 e0 0c             	shl    $0xc,%eax
  800469:	2d 00 00 00 30       	sub    $0x30000000,%eax
	if (!(uvpd[PDX(fd)] & PTE_P) || !(uvpt[PGNUM(fd)] & PTE_P)) {
  80046e:	8b 15 00 dd 7b ef    	mov    0xef7bdd00,%edx
  800474:	f6 c2 01             	test   $0x1,%dl
  800477:	74 24                	je     80049d <fd_lookup+0x46>
  800479:	89 c2                	mov    %eax,%edx
  80047b:	c1 ea 0c             	shr    $0xc,%edx
  80047e:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  800485:	f6 c2 01             	test   $0x1,%dl
  800488:	74 1a                	je     8004a4 <fd_lookup+0x4d>
		if (debug)
			cprintf("[%08x] closed fd %d\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	*fd_store = fd;
  80048a:	8b 55 0c             	mov    0xc(%ebp),%edx
  80048d:	89 02                	mov    %eax,(%edx)
	return 0;
  80048f:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800494:	5d                   	pop    %ebp
  800495:	c3                   	ret    
		return -E_INVAL;
  800496:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  80049b:	eb f7                	jmp    800494 <fd_lookup+0x3d>
		return -E_INVAL;
  80049d:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  8004a2:	eb f0                	jmp    800494 <fd_lookup+0x3d>
  8004a4:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  8004a9:	eb e9                	jmp    800494 <fd_lookup+0x3d>

008004ab <dev_lookup>:
	0
};

int
dev_lookup(int dev_id, struct Dev **dev)
{
  8004ab:	f3 0f 1e fb          	endbr32 
  8004af:	55                   	push   %ebp
  8004b0:	89 e5                	mov    %esp,%ebp
  8004b2:	83 ec 08             	sub    $0x8,%esp
  8004b5:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8004b8:	ba 34 20 80 00       	mov    $0x802034,%edx
	int i;
	for (i = 0; devtab[i]; i++)
  8004bd:	b8 04 30 80 00       	mov    $0x803004,%eax
		if (devtab[i]->dev_id == dev_id) {
  8004c2:	39 08                	cmp    %ecx,(%eax)
  8004c4:	74 33                	je     8004f9 <dev_lookup+0x4e>
  8004c6:	83 c2 04             	add    $0x4,%edx
	for (i = 0; devtab[i]; i++)
  8004c9:	8b 02                	mov    (%edx),%eax
  8004cb:	85 c0                	test   %eax,%eax
  8004cd:	75 f3                	jne    8004c2 <dev_lookup+0x17>
			*dev = devtab[i];
			return 0;
		}
	cprintf("[%08x] unknown device type %d\n", thisenv->env_id, dev_id);
  8004cf:	a1 04 40 80 00       	mov    0x804004,%eax
  8004d4:	8b 40 48             	mov    0x48(%eax),%eax
  8004d7:	83 ec 04             	sub    $0x4,%esp
  8004da:	51                   	push   %ecx
  8004db:	50                   	push   %eax
  8004dc:	68 b8 1f 80 00       	push   $0x801fb8
  8004e1:	e8 18 0d 00 00       	call   8011fe <cprintf>
	*dev = 0;
  8004e6:	8b 45 0c             	mov    0xc(%ebp),%eax
  8004e9:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	return -E_INVAL;
  8004ef:	83 c4 10             	add    $0x10,%esp
  8004f2:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
}
  8004f7:	c9                   	leave  
  8004f8:	c3                   	ret    
			*dev = devtab[i];
  8004f9:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8004fc:	89 01                	mov    %eax,(%ecx)
			return 0;
  8004fe:	b8 00 00 00 00       	mov    $0x0,%eax
  800503:	eb f2                	jmp    8004f7 <dev_lookup+0x4c>

00800505 <fd_close>:
{
  800505:	f3 0f 1e fb          	endbr32 
  800509:	55                   	push   %ebp
  80050a:	89 e5                	mov    %esp,%ebp
  80050c:	57                   	push   %edi
  80050d:	56                   	push   %esi
  80050e:	53                   	push   %ebx
  80050f:	83 ec 24             	sub    $0x24,%esp
  800512:	8b 75 08             	mov    0x8(%ebp),%esi
  800515:	8b 7d 0c             	mov    0xc(%ebp),%edi
	if ((r = fd_lookup(fd2num(fd), &fd2)) < 0
  800518:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  80051b:	50                   	push   %eax
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  80051c:	8d 86 00 00 00 30    	lea    0x30000000(%esi),%eax
  800522:	c1 e8 0c             	shr    $0xc,%eax
	if ((r = fd_lookup(fd2num(fd), &fd2)) < 0
  800525:	50                   	push   %eax
  800526:	e8 2c ff ff ff       	call   800457 <fd_lookup>
  80052b:	89 c3                	mov    %eax,%ebx
  80052d:	83 c4 10             	add    $0x10,%esp
  800530:	85 c0                	test   %eax,%eax
  800532:	78 05                	js     800539 <fd_close+0x34>
	    || fd != fd2)
  800534:	39 75 e4             	cmp    %esi,-0x1c(%ebp)
  800537:	74 16                	je     80054f <fd_close+0x4a>
		return (must_exist ? r : 0);
  800539:	89 f8                	mov    %edi,%eax
  80053b:	84 c0                	test   %al,%al
  80053d:	b8 00 00 00 00       	mov    $0x0,%eax
  800542:	0f 44 d8             	cmove  %eax,%ebx
}
  800545:	89 d8                	mov    %ebx,%eax
  800547:	8d 65 f4             	lea    -0xc(%ebp),%esp
  80054a:	5b                   	pop    %ebx
  80054b:	5e                   	pop    %esi
  80054c:	5f                   	pop    %edi
  80054d:	5d                   	pop    %ebp
  80054e:	c3                   	ret    
	if ((r = dev_lookup(fd->fd_dev_id, &dev)) >= 0) {
  80054f:	83 ec 08             	sub    $0x8,%esp
  800552:	8d 45 e0             	lea    -0x20(%ebp),%eax
  800555:	50                   	push   %eax
  800556:	ff 36                	pushl  (%esi)
  800558:	e8 4e ff ff ff       	call   8004ab <dev_lookup>
  80055d:	89 c3                	mov    %eax,%ebx
  80055f:	83 c4 10             	add    $0x10,%esp
  800562:	85 c0                	test   %eax,%eax
  800564:	78 1a                	js     800580 <fd_close+0x7b>
		if (dev->dev_close)
  800566:	8b 45 e0             	mov    -0x20(%ebp),%eax
  800569:	8b 40 10             	mov    0x10(%eax),%eax
			r = 0;
  80056c:	bb 00 00 00 00       	mov    $0x0,%ebx
		if (dev->dev_close)
  800571:	85 c0                	test   %eax,%eax
  800573:	74 0b                	je     800580 <fd_close+0x7b>
			r = (*dev->dev_close)(fd);
  800575:	83 ec 0c             	sub    $0xc,%esp
  800578:	56                   	push   %esi
  800579:	ff d0                	call   *%eax
  80057b:	89 c3                	mov    %eax,%ebx
  80057d:	83 c4 10             	add    $0x10,%esp
	(void) sys_page_unmap(0, fd);
  800580:	83 ec 08             	sub    $0x8,%esp
  800583:	56                   	push   %esi
  800584:	6a 00                	push   $0x0
  800586:	e8 9c fc ff ff       	call   800227 <sys_page_unmap>
	return r;
  80058b:	83 c4 10             	add    $0x10,%esp
  80058e:	eb b5                	jmp    800545 <fd_close+0x40>

00800590 <close>:

int
close(int fdnum)
{
  800590:	f3 0f 1e fb          	endbr32 
  800594:	55                   	push   %ebp
  800595:	89 e5                	mov    %esp,%ebp
  800597:	83 ec 20             	sub    $0x20,%esp
	struct Fd *fd;
	int r;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  80059a:	8d 45 f4             	lea    -0xc(%ebp),%eax
  80059d:	50                   	push   %eax
  80059e:	ff 75 08             	pushl  0x8(%ebp)
  8005a1:	e8 b1 fe ff ff       	call   800457 <fd_lookup>
  8005a6:	83 c4 10             	add    $0x10,%esp
  8005a9:	85 c0                	test   %eax,%eax
  8005ab:	79 02                	jns    8005af <close+0x1f>
		return r;
	else
		return fd_close(fd, 1);
}
  8005ad:	c9                   	leave  
  8005ae:	c3                   	ret    
		return fd_close(fd, 1);
  8005af:	83 ec 08             	sub    $0x8,%esp
  8005b2:	6a 01                	push   $0x1
  8005b4:	ff 75 f4             	pushl  -0xc(%ebp)
  8005b7:	e8 49 ff ff ff       	call   800505 <fd_close>
  8005bc:	83 c4 10             	add    $0x10,%esp
  8005bf:	eb ec                	jmp    8005ad <close+0x1d>

008005c1 <close_all>:

void
close_all(void)
{
  8005c1:	f3 0f 1e fb          	endbr32 
  8005c5:	55                   	push   %ebp
  8005c6:	89 e5                	mov    %esp,%ebp
  8005c8:	53                   	push   %ebx
  8005c9:	83 ec 04             	sub    $0x4,%esp
	int i;
	for (i = 0; i < MAXFD; i++)
  8005cc:	bb 00 00 00 00       	mov    $0x0,%ebx
		close(i);
  8005d1:	83 ec 0c             	sub    $0xc,%esp
  8005d4:	53                   	push   %ebx
  8005d5:	e8 b6 ff ff ff       	call   800590 <close>
	for (i = 0; i < MAXFD; i++)
  8005da:	83 c3 01             	add    $0x1,%ebx
  8005dd:	83 c4 10             	add    $0x10,%esp
  8005e0:	83 fb 20             	cmp    $0x20,%ebx
  8005e3:	75 ec                	jne    8005d1 <close_all+0x10>
}
  8005e5:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8005e8:	c9                   	leave  
  8005e9:	c3                   	ret    

008005ea <dup>:
// file and the file offset of the other.
// Closes any previously open file descriptor at 'newfdnum'.
// This is implemented using virtual memory tricks (of course!).
int
dup(int oldfdnum, int newfdnum)
{
  8005ea:	f3 0f 1e fb          	endbr32 
  8005ee:	55                   	push   %ebp
  8005ef:	89 e5                	mov    %esp,%ebp
  8005f1:	57                   	push   %edi
  8005f2:	56                   	push   %esi
  8005f3:	53                   	push   %ebx
  8005f4:	83 ec 24             	sub    $0x24,%esp
	int r;
	char *ova, *nva;
	pte_t pte;
	struct Fd *oldfd, *newfd;

	if ((r = fd_lookup(oldfdnum, &oldfd)) < 0)
  8005f7:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  8005fa:	50                   	push   %eax
  8005fb:	ff 75 08             	pushl  0x8(%ebp)
  8005fe:	e8 54 fe ff ff       	call   800457 <fd_lookup>
  800603:	89 c3                	mov    %eax,%ebx
  800605:	83 c4 10             	add    $0x10,%esp
  800608:	85 c0                	test   %eax,%eax
  80060a:	0f 88 81 00 00 00    	js     800691 <dup+0xa7>
		return r;
	close(newfdnum);
  800610:	83 ec 0c             	sub    $0xc,%esp
  800613:	ff 75 0c             	pushl  0xc(%ebp)
  800616:	e8 75 ff ff ff       	call   800590 <close>

	newfd = INDEX2FD(newfdnum);
  80061b:	8b 75 0c             	mov    0xc(%ebp),%esi
  80061e:	c1 e6 0c             	shl    $0xc,%esi
  800621:	81 ee 00 00 00 30    	sub    $0x30000000,%esi
	ova = fd2data(oldfd);
  800627:	83 c4 04             	add    $0x4,%esp
  80062a:	ff 75 e4             	pushl  -0x1c(%ebp)
  80062d:	e8 b4 fd ff ff       	call   8003e6 <fd2data>
  800632:	89 c3                	mov    %eax,%ebx
	nva = fd2data(newfd);
  800634:	89 34 24             	mov    %esi,(%esp)
  800637:	e8 aa fd ff ff       	call   8003e6 <fd2data>
  80063c:	83 c4 10             	add    $0x10,%esp
  80063f:	89 c7                	mov    %eax,%edi

	if ((uvpd[PDX(ova)] & PTE_P) && (uvpt[PGNUM(ova)] & PTE_P))
  800641:	89 d8                	mov    %ebx,%eax
  800643:	c1 e8 16             	shr    $0x16,%eax
  800646:	8b 04 85 00 d0 7b ef 	mov    -0x10843000(,%eax,4),%eax
  80064d:	a8 01                	test   $0x1,%al
  80064f:	74 11                	je     800662 <dup+0x78>
  800651:	89 d8                	mov    %ebx,%eax
  800653:	c1 e8 0c             	shr    $0xc,%eax
  800656:	8b 14 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%edx
  80065d:	f6 c2 01             	test   $0x1,%dl
  800660:	75 39                	jne    80069b <dup+0xb1>
		if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0)
			goto err;
	if ((r = sys_page_map(0, oldfd, 0, newfd, uvpt[PGNUM(oldfd)] & PTE_SYSCALL)) < 0)
  800662:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  800665:	89 d0                	mov    %edx,%eax
  800667:	c1 e8 0c             	shr    $0xc,%eax
  80066a:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  800671:	83 ec 0c             	sub    $0xc,%esp
  800674:	25 07 0e 00 00       	and    $0xe07,%eax
  800679:	50                   	push   %eax
  80067a:	56                   	push   %esi
  80067b:	6a 00                	push   $0x0
  80067d:	52                   	push   %edx
  80067e:	6a 00                	push   $0x0
  800680:	e8 5c fb ff ff       	call   8001e1 <sys_page_map>
  800685:	89 c3                	mov    %eax,%ebx
  800687:	83 c4 20             	add    $0x20,%esp
  80068a:	85 c0                	test   %eax,%eax
  80068c:	78 31                	js     8006bf <dup+0xd5>
		goto err;

	return newfdnum;
  80068e:	8b 5d 0c             	mov    0xc(%ebp),%ebx

err:
	sys_page_unmap(0, newfd);
	sys_page_unmap(0, nva);
	return r;
}
  800691:	89 d8                	mov    %ebx,%eax
  800693:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800696:	5b                   	pop    %ebx
  800697:	5e                   	pop    %esi
  800698:	5f                   	pop    %edi
  800699:	5d                   	pop    %ebp
  80069a:	c3                   	ret    
		if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0)
  80069b:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  8006a2:	83 ec 0c             	sub    $0xc,%esp
  8006a5:	25 07 0e 00 00       	and    $0xe07,%eax
  8006aa:	50                   	push   %eax
  8006ab:	57                   	push   %edi
  8006ac:	6a 00                	push   $0x0
  8006ae:	53                   	push   %ebx
  8006af:	6a 00                	push   $0x0
  8006b1:	e8 2b fb ff ff       	call   8001e1 <sys_page_map>
  8006b6:	89 c3                	mov    %eax,%ebx
  8006b8:	83 c4 20             	add    $0x20,%esp
  8006bb:	85 c0                	test   %eax,%eax
  8006bd:	79 a3                	jns    800662 <dup+0x78>
	sys_page_unmap(0, newfd);
  8006bf:	83 ec 08             	sub    $0x8,%esp
  8006c2:	56                   	push   %esi
  8006c3:	6a 00                	push   $0x0
  8006c5:	e8 5d fb ff ff       	call   800227 <sys_page_unmap>
	sys_page_unmap(0, nva);
  8006ca:	83 c4 08             	add    $0x8,%esp
  8006cd:	57                   	push   %edi
  8006ce:	6a 00                	push   $0x0
  8006d0:	e8 52 fb ff ff       	call   800227 <sys_page_unmap>
	return r;
  8006d5:	83 c4 10             	add    $0x10,%esp
  8006d8:	eb b7                	jmp    800691 <dup+0xa7>

008006da <read>:

ssize_t
read(int fdnum, void *buf, size_t n)
{
  8006da:	f3 0f 1e fb          	endbr32 
  8006de:	55                   	push   %ebp
  8006df:	89 e5                	mov    %esp,%ebp
  8006e1:	53                   	push   %ebx
  8006e2:	83 ec 1c             	sub    $0x1c,%esp
  8006e5:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  8006e8:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8006eb:	50                   	push   %eax
  8006ec:	53                   	push   %ebx
  8006ed:	e8 65 fd ff ff       	call   800457 <fd_lookup>
  8006f2:	83 c4 10             	add    $0x10,%esp
  8006f5:	85 c0                	test   %eax,%eax
  8006f7:	78 3f                	js     800738 <read+0x5e>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  8006f9:	83 ec 08             	sub    $0x8,%esp
  8006fc:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8006ff:	50                   	push   %eax
  800700:	8b 45 f0             	mov    -0x10(%ebp),%eax
  800703:	ff 30                	pushl  (%eax)
  800705:	e8 a1 fd ff ff       	call   8004ab <dev_lookup>
  80070a:	83 c4 10             	add    $0x10,%esp
  80070d:	85 c0                	test   %eax,%eax
  80070f:	78 27                	js     800738 <read+0x5e>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_WRONLY) {
  800711:	8b 55 f0             	mov    -0x10(%ebp),%edx
  800714:	8b 42 08             	mov    0x8(%edx),%eax
  800717:	83 e0 03             	and    $0x3,%eax
  80071a:	83 f8 01             	cmp    $0x1,%eax
  80071d:	74 1e                	je     80073d <read+0x63>
		cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	if (!dev->dev_read)
  80071f:	8b 45 f4             	mov    -0xc(%ebp),%eax
  800722:	8b 40 08             	mov    0x8(%eax),%eax
  800725:	85 c0                	test   %eax,%eax
  800727:	74 35                	je     80075e <read+0x84>
		return -E_NOT_SUPP;
	return (*dev->dev_read)(fd, buf, n);
  800729:	83 ec 04             	sub    $0x4,%esp
  80072c:	ff 75 10             	pushl  0x10(%ebp)
  80072f:	ff 75 0c             	pushl  0xc(%ebp)
  800732:	52                   	push   %edx
  800733:	ff d0                	call   *%eax
  800735:	83 c4 10             	add    $0x10,%esp
}
  800738:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  80073b:	c9                   	leave  
  80073c:	c3                   	ret    
		cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum);
  80073d:	a1 04 40 80 00       	mov    0x804004,%eax
  800742:	8b 40 48             	mov    0x48(%eax),%eax
  800745:	83 ec 04             	sub    $0x4,%esp
  800748:	53                   	push   %ebx
  800749:	50                   	push   %eax
  80074a:	68 f9 1f 80 00       	push   $0x801ff9
  80074f:	e8 aa 0a 00 00       	call   8011fe <cprintf>
		return -E_INVAL;
  800754:	83 c4 10             	add    $0x10,%esp
  800757:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  80075c:	eb da                	jmp    800738 <read+0x5e>
		return -E_NOT_SUPP;
  80075e:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  800763:	eb d3                	jmp    800738 <read+0x5e>

00800765 <readn>:

ssize_t
readn(int fdnum, void *buf, size_t n)
{
  800765:	f3 0f 1e fb          	endbr32 
  800769:	55                   	push   %ebp
  80076a:	89 e5                	mov    %esp,%ebp
  80076c:	57                   	push   %edi
  80076d:	56                   	push   %esi
  80076e:	53                   	push   %ebx
  80076f:	83 ec 0c             	sub    $0xc,%esp
  800772:	8b 7d 08             	mov    0x8(%ebp),%edi
  800775:	8b 75 10             	mov    0x10(%ebp),%esi
	int m, tot;

	for (tot = 0; tot < n; tot += m) {
  800778:	bb 00 00 00 00       	mov    $0x0,%ebx
  80077d:	eb 02                	jmp    800781 <readn+0x1c>
  80077f:	01 c3                	add    %eax,%ebx
  800781:	39 f3                	cmp    %esi,%ebx
  800783:	73 21                	jae    8007a6 <readn+0x41>
		m = read(fdnum, (char*)buf + tot, n - tot);
  800785:	83 ec 04             	sub    $0x4,%esp
  800788:	89 f0                	mov    %esi,%eax
  80078a:	29 d8                	sub    %ebx,%eax
  80078c:	50                   	push   %eax
  80078d:	89 d8                	mov    %ebx,%eax
  80078f:	03 45 0c             	add    0xc(%ebp),%eax
  800792:	50                   	push   %eax
  800793:	57                   	push   %edi
  800794:	e8 41 ff ff ff       	call   8006da <read>
		if (m < 0)
  800799:	83 c4 10             	add    $0x10,%esp
  80079c:	85 c0                	test   %eax,%eax
  80079e:	78 04                	js     8007a4 <readn+0x3f>
			return m;
		if (m == 0)
  8007a0:	75 dd                	jne    80077f <readn+0x1a>
  8007a2:	eb 02                	jmp    8007a6 <readn+0x41>
		m = read(fdnum, (char*)buf + tot, n - tot);
  8007a4:	89 c3                	mov    %eax,%ebx
			break;
	}
	return tot;
}
  8007a6:	89 d8                	mov    %ebx,%eax
  8007a8:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8007ab:	5b                   	pop    %ebx
  8007ac:	5e                   	pop    %esi
  8007ad:	5f                   	pop    %edi
  8007ae:	5d                   	pop    %ebp
  8007af:	c3                   	ret    

008007b0 <write>:

ssize_t
write(int fdnum, const void *buf, size_t n)
{
  8007b0:	f3 0f 1e fb          	endbr32 
  8007b4:	55                   	push   %ebp
  8007b5:	89 e5                	mov    %esp,%ebp
  8007b7:	53                   	push   %ebx
  8007b8:	83 ec 1c             	sub    $0x1c,%esp
  8007bb:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  8007be:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8007c1:	50                   	push   %eax
  8007c2:	53                   	push   %ebx
  8007c3:	e8 8f fc ff ff       	call   800457 <fd_lookup>
  8007c8:	83 c4 10             	add    $0x10,%esp
  8007cb:	85 c0                	test   %eax,%eax
  8007cd:	78 3a                	js     800809 <write+0x59>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  8007cf:	83 ec 08             	sub    $0x8,%esp
  8007d2:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8007d5:	50                   	push   %eax
  8007d6:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8007d9:	ff 30                	pushl  (%eax)
  8007db:	e8 cb fc ff ff       	call   8004ab <dev_lookup>
  8007e0:	83 c4 10             	add    $0x10,%esp
  8007e3:	85 c0                	test   %eax,%eax
  8007e5:	78 22                	js     800809 <write+0x59>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  8007e7:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8007ea:	f6 40 08 03          	testb  $0x3,0x8(%eax)
  8007ee:	74 1e                	je     80080e <write+0x5e>
		return -E_INVAL;
	}
	if (debug)
		cprintf("write %d %p %d via dev %s\n",
			fdnum, buf, n, dev->dev_name);
	if (!dev->dev_write)
  8007f0:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8007f3:	8b 52 0c             	mov    0xc(%edx),%edx
  8007f6:	85 d2                	test   %edx,%edx
  8007f8:	74 35                	je     80082f <write+0x7f>
		return -E_NOT_SUPP;
	return (*dev->dev_write)(fd, buf, n);
  8007fa:	83 ec 04             	sub    $0x4,%esp
  8007fd:	ff 75 10             	pushl  0x10(%ebp)
  800800:	ff 75 0c             	pushl  0xc(%ebp)
  800803:	50                   	push   %eax
  800804:	ff d2                	call   *%edx
  800806:	83 c4 10             	add    $0x10,%esp
}
  800809:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  80080c:	c9                   	leave  
  80080d:	c3                   	ret    
		cprintf("[%08x] write %d -- bad mode\n", thisenv->env_id, fdnum);
  80080e:	a1 04 40 80 00       	mov    0x804004,%eax
  800813:	8b 40 48             	mov    0x48(%eax),%eax
  800816:	83 ec 04             	sub    $0x4,%esp
  800819:	53                   	push   %ebx
  80081a:	50                   	push   %eax
  80081b:	68 15 20 80 00       	push   $0x802015
  800820:	e8 d9 09 00 00       	call   8011fe <cprintf>
		return -E_INVAL;
  800825:	83 c4 10             	add    $0x10,%esp
  800828:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  80082d:	eb da                	jmp    800809 <write+0x59>
		return -E_NOT_SUPP;
  80082f:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  800834:	eb d3                	jmp    800809 <write+0x59>

00800836 <seek>:

int
seek(int fdnum, off_t offset)
{
  800836:	f3 0f 1e fb          	endbr32 
  80083a:	55                   	push   %ebp
  80083b:	89 e5                	mov    %esp,%ebp
  80083d:	83 ec 20             	sub    $0x20,%esp
	int r;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  800840:	8d 45 f4             	lea    -0xc(%ebp),%eax
  800843:	50                   	push   %eax
  800844:	ff 75 08             	pushl  0x8(%ebp)
  800847:	e8 0b fc ff ff       	call   800457 <fd_lookup>
  80084c:	83 c4 10             	add    $0x10,%esp
  80084f:	85 c0                	test   %eax,%eax
  800851:	78 0e                	js     800861 <seek+0x2b>
		return r;
	fd->fd_offset = offset;
  800853:	8b 55 0c             	mov    0xc(%ebp),%edx
  800856:	8b 45 f4             	mov    -0xc(%ebp),%eax
  800859:	89 50 04             	mov    %edx,0x4(%eax)
	return 0;
  80085c:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800861:	c9                   	leave  
  800862:	c3                   	ret    

00800863 <ftruncate>:

int
ftruncate(int fdnum, off_t newsize)
{
  800863:	f3 0f 1e fb          	endbr32 
  800867:	55                   	push   %ebp
  800868:	89 e5                	mov    %esp,%ebp
  80086a:	53                   	push   %ebx
  80086b:	83 ec 1c             	sub    $0x1c,%esp
  80086e:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;
	if ((r = fd_lookup(fdnum, &fd)) < 0
  800871:	8d 45 f0             	lea    -0x10(%ebp),%eax
  800874:	50                   	push   %eax
  800875:	53                   	push   %ebx
  800876:	e8 dc fb ff ff       	call   800457 <fd_lookup>
  80087b:	83 c4 10             	add    $0x10,%esp
  80087e:	85 c0                	test   %eax,%eax
  800880:	78 37                	js     8008b9 <ftruncate+0x56>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  800882:	83 ec 08             	sub    $0x8,%esp
  800885:	8d 45 f4             	lea    -0xc(%ebp),%eax
  800888:	50                   	push   %eax
  800889:	8b 45 f0             	mov    -0x10(%ebp),%eax
  80088c:	ff 30                	pushl  (%eax)
  80088e:	e8 18 fc ff ff       	call   8004ab <dev_lookup>
  800893:	83 c4 10             	add    $0x10,%esp
  800896:	85 c0                	test   %eax,%eax
  800898:	78 1f                	js     8008b9 <ftruncate+0x56>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  80089a:	8b 45 f0             	mov    -0x10(%ebp),%eax
  80089d:	f6 40 08 03          	testb  $0x3,0x8(%eax)
  8008a1:	74 1b                	je     8008be <ftruncate+0x5b>
		cprintf("[%08x] ftruncate %d -- bad mode\n",
			thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	if (!dev->dev_trunc)
  8008a3:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8008a6:	8b 52 18             	mov    0x18(%edx),%edx
  8008a9:	85 d2                	test   %edx,%edx
  8008ab:	74 32                	je     8008df <ftruncate+0x7c>
		return -E_NOT_SUPP;
	return (*dev->dev_trunc)(fd, newsize);
  8008ad:	83 ec 08             	sub    $0x8,%esp
  8008b0:	ff 75 0c             	pushl  0xc(%ebp)
  8008b3:	50                   	push   %eax
  8008b4:	ff d2                	call   *%edx
  8008b6:	83 c4 10             	add    $0x10,%esp
}
  8008b9:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8008bc:	c9                   	leave  
  8008bd:	c3                   	ret    
			thisenv->env_id, fdnum);
  8008be:	a1 04 40 80 00       	mov    0x804004,%eax
		cprintf("[%08x] ftruncate %d -- bad mode\n",
  8008c3:	8b 40 48             	mov    0x48(%eax),%eax
  8008c6:	83 ec 04             	sub    $0x4,%esp
  8008c9:	53                   	push   %ebx
  8008ca:	50                   	push   %eax
  8008cb:	68 d8 1f 80 00       	push   $0x801fd8
  8008d0:	e8 29 09 00 00       	call   8011fe <cprintf>
		return -E_INVAL;
  8008d5:	83 c4 10             	add    $0x10,%esp
  8008d8:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  8008dd:	eb da                	jmp    8008b9 <ftruncate+0x56>
		return -E_NOT_SUPP;
  8008df:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  8008e4:	eb d3                	jmp    8008b9 <ftruncate+0x56>

008008e6 <fstat>:

int
fstat(int fdnum, struct Stat *stat)
{
  8008e6:	f3 0f 1e fb          	endbr32 
  8008ea:	55                   	push   %ebp
  8008eb:	89 e5                	mov    %esp,%ebp
  8008ed:	53                   	push   %ebx
  8008ee:	83 ec 1c             	sub    $0x1c,%esp
  8008f1:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  8008f4:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8008f7:	50                   	push   %eax
  8008f8:	ff 75 08             	pushl  0x8(%ebp)
  8008fb:	e8 57 fb ff ff       	call   800457 <fd_lookup>
  800900:	83 c4 10             	add    $0x10,%esp
  800903:	85 c0                	test   %eax,%eax
  800905:	78 4b                	js     800952 <fstat+0x6c>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  800907:	83 ec 08             	sub    $0x8,%esp
  80090a:	8d 45 f4             	lea    -0xc(%ebp),%eax
  80090d:	50                   	push   %eax
  80090e:	8b 45 f0             	mov    -0x10(%ebp),%eax
  800911:	ff 30                	pushl  (%eax)
  800913:	e8 93 fb ff ff       	call   8004ab <dev_lookup>
  800918:	83 c4 10             	add    $0x10,%esp
  80091b:	85 c0                	test   %eax,%eax
  80091d:	78 33                	js     800952 <fstat+0x6c>
		return r;
	if (!dev->dev_stat)
  80091f:	8b 45 f4             	mov    -0xc(%ebp),%eax
  800922:	83 78 14 00          	cmpl   $0x0,0x14(%eax)
  800926:	74 2f                	je     800957 <fstat+0x71>
		return -E_NOT_SUPP;
	stat->st_name[0] = 0;
  800928:	c6 03 00             	movb   $0x0,(%ebx)
	stat->st_size = 0;
  80092b:	c7 83 80 00 00 00 00 	movl   $0x0,0x80(%ebx)
  800932:	00 00 00 
	stat->st_isdir = 0;
  800935:	c7 83 84 00 00 00 00 	movl   $0x0,0x84(%ebx)
  80093c:	00 00 00 
	stat->st_dev = dev;
  80093f:	89 83 88 00 00 00    	mov    %eax,0x88(%ebx)
	return (*dev->dev_stat)(fd, stat);
  800945:	83 ec 08             	sub    $0x8,%esp
  800948:	53                   	push   %ebx
  800949:	ff 75 f0             	pushl  -0x10(%ebp)
  80094c:	ff 50 14             	call   *0x14(%eax)
  80094f:	83 c4 10             	add    $0x10,%esp
}
  800952:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  800955:	c9                   	leave  
  800956:	c3                   	ret    
		return -E_NOT_SUPP;
  800957:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  80095c:	eb f4                	jmp    800952 <fstat+0x6c>

0080095e <stat>:

int
stat(const char *path, struct Stat *stat)
{
  80095e:	f3 0f 1e fb          	endbr32 
  800962:	55                   	push   %ebp
  800963:	89 e5                	mov    %esp,%ebp
  800965:	56                   	push   %esi
  800966:	53                   	push   %ebx
	int fd, r;

	if ((fd = open(path, O_RDONLY)) < 0)
  800967:	83 ec 08             	sub    $0x8,%esp
  80096a:	6a 00                	push   $0x0
  80096c:	ff 75 08             	pushl  0x8(%ebp)
  80096f:	e8 fb 01 00 00       	call   800b6f <open>
  800974:	89 c3                	mov    %eax,%ebx
  800976:	83 c4 10             	add    $0x10,%esp
  800979:	85 c0                	test   %eax,%eax
  80097b:	78 1b                	js     800998 <stat+0x3a>
		return fd;
	r = fstat(fd, stat);
  80097d:	83 ec 08             	sub    $0x8,%esp
  800980:	ff 75 0c             	pushl  0xc(%ebp)
  800983:	50                   	push   %eax
  800984:	e8 5d ff ff ff       	call   8008e6 <fstat>
  800989:	89 c6                	mov    %eax,%esi
	close(fd);
  80098b:	89 1c 24             	mov    %ebx,(%esp)
  80098e:	e8 fd fb ff ff       	call   800590 <close>
	return r;
  800993:	83 c4 10             	add    $0x10,%esp
  800996:	89 f3                	mov    %esi,%ebx
}
  800998:	89 d8                	mov    %ebx,%eax
  80099a:	8d 65 f8             	lea    -0x8(%ebp),%esp
  80099d:	5b                   	pop    %ebx
  80099e:	5e                   	pop    %esi
  80099f:	5d                   	pop    %ebp
  8009a0:	c3                   	ret    

008009a1 <fsipc>:
// type: request code, passed as the simple integer IPC value.
// dstva: virtual address at which to receive reply page, 0 if none.
// Returns result from the file server.
static int
fsipc(unsigned type, void *dstva)
{
  8009a1:	55                   	push   %ebp
  8009a2:	89 e5                	mov    %esp,%ebp
  8009a4:	56                   	push   %esi
  8009a5:	53                   	push   %ebx
  8009a6:	89 c6                	mov    %eax,%esi
  8009a8:	89 d3                	mov    %edx,%ebx
	static envid_t fsenv;
	if (fsenv == 0)
  8009aa:	83 3d 00 40 80 00 00 	cmpl   $0x0,0x804000
  8009b1:	74 27                	je     8009da <fsipc+0x39>
	static_assert(sizeof(fsipcbuf) == PGSIZE);

	if (debug)
		cprintf("[%08x] fsipc %d %08x\n", thisenv->env_id, type, *(uint32_t *)&fsipcbuf);

	ipc_send(fsenv, type, &fsipcbuf, PTE_P | PTE_W | PTE_U);
  8009b3:	6a 07                	push   $0x7
  8009b5:	68 00 50 80 00       	push   $0x805000
  8009ba:	56                   	push   %esi
  8009bb:	ff 35 00 40 80 00    	pushl  0x804000
  8009c1:	e8 7e 12 00 00       	call   801c44 <ipc_send>
	return ipc_recv(NULL, dstva, NULL);
  8009c6:	83 c4 0c             	add    $0xc,%esp
  8009c9:	6a 00                	push   $0x0
  8009cb:	53                   	push   %ebx
  8009cc:	6a 00                	push   $0x0
  8009ce:	e8 f0 11 00 00       	call   801bc3 <ipc_recv>
}
  8009d3:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8009d6:	5b                   	pop    %ebx
  8009d7:	5e                   	pop    %esi
  8009d8:	5d                   	pop    %ebp
  8009d9:	c3                   	ret    
		fsenv = ipc_find_env(ENV_TYPE_FS);
  8009da:	83 ec 0c             	sub    $0xc,%esp
  8009dd:	6a 01                	push   $0x1
  8009df:	e8 b8 12 00 00       	call   801c9c <ipc_find_env>
  8009e4:	a3 00 40 80 00       	mov    %eax,0x804000
  8009e9:	83 c4 10             	add    $0x10,%esp
  8009ec:	eb c5                	jmp    8009b3 <fsipc+0x12>

008009ee <devfile_trunc>:
}

// Truncate or extend an open file to 'size' bytes
static int
devfile_trunc(struct Fd *fd, off_t newsize)
{
  8009ee:	f3 0f 1e fb          	endbr32 
  8009f2:	55                   	push   %ebp
  8009f3:	89 e5                	mov    %esp,%ebp
  8009f5:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.set_size.req_fileid = fd->fd_file.id;
  8009f8:	8b 45 08             	mov    0x8(%ebp),%eax
  8009fb:	8b 40 0c             	mov    0xc(%eax),%eax
  8009fe:	a3 00 50 80 00       	mov    %eax,0x805000
	fsipcbuf.set_size.req_size = newsize;
  800a03:	8b 45 0c             	mov    0xc(%ebp),%eax
  800a06:	a3 04 50 80 00       	mov    %eax,0x805004
	return fsipc(FSREQ_SET_SIZE, NULL);
  800a0b:	ba 00 00 00 00       	mov    $0x0,%edx
  800a10:	b8 02 00 00 00       	mov    $0x2,%eax
  800a15:	e8 87 ff ff ff       	call   8009a1 <fsipc>
}
  800a1a:	c9                   	leave  
  800a1b:	c3                   	ret    

00800a1c <devfile_flush>:
{
  800a1c:	f3 0f 1e fb          	endbr32 
  800a20:	55                   	push   %ebp
  800a21:	89 e5                	mov    %esp,%ebp
  800a23:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.flush.req_fileid = fd->fd_file.id;
  800a26:	8b 45 08             	mov    0x8(%ebp),%eax
  800a29:	8b 40 0c             	mov    0xc(%eax),%eax
  800a2c:	a3 00 50 80 00       	mov    %eax,0x805000
	return fsipc(FSREQ_FLUSH, NULL);
  800a31:	ba 00 00 00 00       	mov    $0x0,%edx
  800a36:	b8 06 00 00 00       	mov    $0x6,%eax
  800a3b:	e8 61 ff ff ff       	call   8009a1 <fsipc>
}
  800a40:	c9                   	leave  
  800a41:	c3                   	ret    

00800a42 <devfile_stat>:
{
  800a42:	f3 0f 1e fb          	endbr32 
  800a46:	55                   	push   %ebp
  800a47:	89 e5                	mov    %esp,%ebp
  800a49:	53                   	push   %ebx
  800a4a:	83 ec 04             	sub    $0x4,%esp
  800a4d:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	fsipcbuf.stat.req_fileid = fd->fd_file.id;
  800a50:	8b 45 08             	mov    0x8(%ebp),%eax
  800a53:	8b 40 0c             	mov    0xc(%eax),%eax
  800a56:	a3 00 50 80 00       	mov    %eax,0x805000
	if ((r = fsipc(FSREQ_STAT, NULL)) < 0)
  800a5b:	ba 00 00 00 00       	mov    $0x0,%edx
  800a60:	b8 05 00 00 00       	mov    $0x5,%eax
  800a65:	e8 37 ff ff ff       	call   8009a1 <fsipc>
  800a6a:	85 c0                	test   %eax,%eax
  800a6c:	78 2c                	js     800a9a <devfile_stat+0x58>
	strcpy(st->st_name, fsipcbuf.statRet.ret_name);
  800a6e:	83 ec 08             	sub    $0x8,%esp
  800a71:	68 00 50 80 00       	push   $0x805000
  800a76:	53                   	push   %ebx
  800a77:	e8 5b 0d 00 00       	call   8017d7 <strcpy>
	st->st_size = fsipcbuf.statRet.ret_size;
  800a7c:	a1 80 50 80 00       	mov    0x805080,%eax
  800a81:	89 83 80 00 00 00    	mov    %eax,0x80(%ebx)
	st->st_isdir = fsipcbuf.statRet.ret_isdir;
  800a87:	a1 84 50 80 00       	mov    0x805084,%eax
  800a8c:	89 83 84 00 00 00    	mov    %eax,0x84(%ebx)
	return 0;
  800a92:	83 c4 10             	add    $0x10,%esp
  800a95:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800a9a:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  800a9d:	c9                   	leave  
  800a9e:	c3                   	ret    

00800a9f <devfile_write>:
{
  800a9f:	f3 0f 1e fb          	endbr32 
  800aa3:	55                   	push   %ebp
  800aa4:	89 e5                	mov    %esp,%ebp
  800aa6:	83 ec 0c             	sub    $0xc,%esp
  800aa9:	8b 45 10             	mov    0x10(%ebp),%eax
  800aac:	3d f8 0f 00 00       	cmp    $0xff8,%eax
  800ab1:	ba f8 0f 00 00       	mov    $0xff8,%edx
  800ab6:	0f 47 c2             	cmova  %edx,%eax
	fsipcbuf.write.req_fileid = fd->fd_file.id;
  800ab9:	8b 55 08             	mov    0x8(%ebp),%edx
  800abc:	8b 52 0c             	mov    0xc(%edx),%edx
  800abf:	89 15 00 50 80 00    	mov    %edx,0x805000
	fsipcbuf.write.req_n = n;
  800ac5:	a3 04 50 80 00       	mov    %eax,0x805004
	memmove(fsipcbuf.write.req_buf, buf, n);
  800aca:	50                   	push   %eax
  800acb:	ff 75 0c             	pushl  0xc(%ebp)
  800ace:	68 08 50 80 00       	push   $0x805008
  800ad3:	e8 b5 0e 00 00       	call   80198d <memmove>
	return fsipc(FSREQ_WRITE, NULL);}
  800ad8:	ba 00 00 00 00       	mov    $0x0,%edx
  800add:	b8 04 00 00 00       	mov    $0x4,%eax
  800ae2:	e8 ba fe ff ff       	call   8009a1 <fsipc>
  800ae7:	c9                   	leave  
  800ae8:	c3                   	ret    

00800ae9 <devfile_read>:
{
  800ae9:	f3 0f 1e fb          	endbr32 
  800aed:	55                   	push   %ebp
  800aee:	89 e5                	mov    %esp,%ebp
  800af0:	56                   	push   %esi
  800af1:	53                   	push   %ebx
  800af2:	8b 75 10             	mov    0x10(%ebp),%esi
	fsipcbuf.read.req_fileid = fd->fd_file.id;
  800af5:	8b 45 08             	mov    0x8(%ebp),%eax
  800af8:	8b 40 0c             	mov    0xc(%eax),%eax
  800afb:	a3 00 50 80 00       	mov    %eax,0x805000
	fsipcbuf.read.req_n = n;
  800b00:	89 35 04 50 80 00    	mov    %esi,0x805004
	if ((r = fsipc(FSREQ_READ, NULL)) < 0)
  800b06:	ba 00 00 00 00       	mov    $0x0,%edx
  800b0b:	b8 03 00 00 00       	mov    $0x3,%eax
  800b10:	e8 8c fe ff ff       	call   8009a1 <fsipc>
  800b15:	89 c3                	mov    %eax,%ebx
  800b17:	85 c0                	test   %eax,%eax
  800b19:	78 1f                	js     800b3a <devfile_read+0x51>
	assert(r <= n);
  800b1b:	39 f0                	cmp    %esi,%eax
  800b1d:	77 24                	ja     800b43 <devfile_read+0x5a>
	assert(r <= PGSIZE);
  800b1f:	3d 00 10 00 00       	cmp    $0x1000,%eax
  800b24:	7f 33                	jg     800b59 <devfile_read+0x70>
	memmove(buf, fsipcbuf.readRet.ret_buf, r);
  800b26:	83 ec 04             	sub    $0x4,%esp
  800b29:	50                   	push   %eax
  800b2a:	68 00 50 80 00       	push   $0x805000
  800b2f:	ff 75 0c             	pushl  0xc(%ebp)
  800b32:	e8 56 0e 00 00       	call   80198d <memmove>
	return r;
  800b37:	83 c4 10             	add    $0x10,%esp
}
  800b3a:	89 d8                	mov    %ebx,%eax
  800b3c:	8d 65 f8             	lea    -0x8(%ebp),%esp
  800b3f:	5b                   	pop    %ebx
  800b40:	5e                   	pop    %esi
  800b41:	5d                   	pop    %ebp
  800b42:	c3                   	ret    
	assert(r <= n);
  800b43:	68 44 20 80 00       	push   $0x802044
  800b48:	68 4b 20 80 00       	push   $0x80204b
  800b4d:	6a 7c                	push   $0x7c
  800b4f:	68 60 20 80 00       	push   $0x802060
  800b54:	e8 be 05 00 00       	call   801117 <_panic>
	assert(r <= PGSIZE);
  800b59:	68 6b 20 80 00       	push   $0x80206b
  800b5e:	68 4b 20 80 00       	push   $0x80204b
  800b63:	6a 7d                	push   $0x7d
  800b65:	68 60 20 80 00       	push   $0x802060
  800b6a:	e8 a8 05 00 00       	call   801117 <_panic>

00800b6f <open>:
{
  800b6f:	f3 0f 1e fb          	endbr32 
  800b73:	55                   	push   %ebp
  800b74:	89 e5                	mov    %esp,%ebp
  800b76:	56                   	push   %esi
  800b77:	53                   	push   %ebx
  800b78:	83 ec 1c             	sub    $0x1c,%esp
  800b7b:	8b 75 08             	mov    0x8(%ebp),%esi
	if (strlen(path) >= MAXPATHLEN)
  800b7e:	56                   	push   %esi
  800b7f:	e8 10 0c 00 00       	call   801794 <strlen>
  800b84:	83 c4 10             	add    $0x10,%esp
  800b87:	3d ff 03 00 00       	cmp    $0x3ff,%eax
  800b8c:	7f 6c                	jg     800bfa <open+0x8b>
	if ((r = fd_alloc(&fd)) < 0)
  800b8e:	83 ec 0c             	sub    $0xc,%esp
  800b91:	8d 45 f4             	lea    -0xc(%ebp),%eax
  800b94:	50                   	push   %eax
  800b95:	e8 67 f8 ff ff       	call   800401 <fd_alloc>
  800b9a:	89 c3                	mov    %eax,%ebx
  800b9c:	83 c4 10             	add    $0x10,%esp
  800b9f:	85 c0                	test   %eax,%eax
  800ba1:	78 3c                	js     800bdf <open+0x70>
	strcpy(fsipcbuf.open.req_path, path);
  800ba3:	83 ec 08             	sub    $0x8,%esp
  800ba6:	56                   	push   %esi
  800ba7:	68 00 50 80 00       	push   $0x805000
  800bac:	e8 26 0c 00 00       	call   8017d7 <strcpy>
	fsipcbuf.open.req_omode = mode;
  800bb1:	8b 45 0c             	mov    0xc(%ebp),%eax
  800bb4:	a3 00 54 80 00       	mov    %eax,0x805400
	if ((r = fsipc(FSREQ_OPEN, fd)) < 0) {
  800bb9:	8b 55 f4             	mov    -0xc(%ebp),%edx
  800bbc:	b8 01 00 00 00       	mov    $0x1,%eax
  800bc1:	e8 db fd ff ff       	call   8009a1 <fsipc>
  800bc6:	89 c3                	mov    %eax,%ebx
  800bc8:	83 c4 10             	add    $0x10,%esp
  800bcb:	85 c0                	test   %eax,%eax
  800bcd:	78 19                	js     800be8 <open+0x79>
	return fd2num(fd);
  800bcf:	83 ec 0c             	sub    $0xc,%esp
  800bd2:	ff 75 f4             	pushl  -0xc(%ebp)
  800bd5:	e8 f8 f7 ff ff       	call   8003d2 <fd2num>
  800bda:	89 c3                	mov    %eax,%ebx
  800bdc:	83 c4 10             	add    $0x10,%esp
}
  800bdf:	89 d8                	mov    %ebx,%eax
  800be1:	8d 65 f8             	lea    -0x8(%ebp),%esp
  800be4:	5b                   	pop    %ebx
  800be5:	5e                   	pop    %esi
  800be6:	5d                   	pop    %ebp
  800be7:	c3                   	ret    
		fd_close(fd, 0);
  800be8:	83 ec 08             	sub    $0x8,%esp
  800beb:	6a 00                	push   $0x0
  800bed:	ff 75 f4             	pushl  -0xc(%ebp)
  800bf0:	e8 10 f9 ff ff       	call   800505 <fd_close>
		return r;
  800bf5:	83 c4 10             	add    $0x10,%esp
  800bf8:	eb e5                	jmp    800bdf <open+0x70>
		return -E_BAD_PATH;
  800bfa:	bb f4 ff ff ff       	mov    $0xfffffff4,%ebx
  800bff:	eb de                	jmp    800bdf <open+0x70>

00800c01 <sync>:


// Synchronize disk with buffer cache
int
sync(void)
{
  800c01:	f3 0f 1e fb          	endbr32 
  800c05:	55                   	push   %ebp
  800c06:	89 e5                	mov    %esp,%ebp
  800c08:	83 ec 08             	sub    $0x8,%esp
	// Ask the file server to update the disk
	// by writing any dirty blocks in the buffer cache.

	return fsipc(FSREQ_SYNC, NULL);
  800c0b:	ba 00 00 00 00       	mov    $0x0,%edx
  800c10:	b8 08 00 00 00       	mov    $0x8,%eax
  800c15:	e8 87 fd ff ff       	call   8009a1 <fsipc>
}
  800c1a:	c9                   	leave  
  800c1b:	c3                   	ret    

00800c1c <devpipe_stat>:
	return i;
}

static int
devpipe_stat(struct Fd *fd, struct Stat *stat)
{
  800c1c:	f3 0f 1e fb          	endbr32 
  800c20:	55                   	push   %ebp
  800c21:	89 e5                	mov    %esp,%ebp
  800c23:	56                   	push   %esi
  800c24:	53                   	push   %ebx
  800c25:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	struct Pipe *p = (struct Pipe*) fd2data(fd);
  800c28:	83 ec 0c             	sub    $0xc,%esp
  800c2b:	ff 75 08             	pushl  0x8(%ebp)
  800c2e:	e8 b3 f7 ff ff       	call   8003e6 <fd2data>
  800c33:	89 c6                	mov    %eax,%esi
	strcpy(stat->st_name, "<pipe>");
  800c35:	83 c4 08             	add    $0x8,%esp
  800c38:	68 77 20 80 00       	push   $0x802077
  800c3d:	53                   	push   %ebx
  800c3e:	e8 94 0b 00 00       	call   8017d7 <strcpy>
	stat->st_size = p->p_wpos - p->p_rpos;
  800c43:	8b 46 04             	mov    0x4(%esi),%eax
  800c46:	2b 06                	sub    (%esi),%eax
  800c48:	89 83 80 00 00 00    	mov    %eax,0x80(%ebx)
	stat->st_isdir = 0;
  800c4e:	c7 83 84 00 00 00 00 	movl   $0x0,0x84(%ebx)
  800c55:	00 00 00 
	stat->st_dev = &devpipe;
  800c58:	c7 83 88 00 00 00 20 	movl   $0x803020,0x88(%ebx)
  800c5f:	30 80 00 
	return 0;
}
  800c62:	b8 00 00 00 00       	mov    $0x0,%eax
  800c67:	8d 65 f8             	lea    -0x8(%ebp),%esp
  800c6a:	5b                   	pop    %ebx
  800c6b:	5e                   	pop    %esi
  800c6c:	5d                   	pop    %ebp
  800c6d:	c3                   	ret    

00800c6e <devpipe_close>:

static int
devpipe_close(struct Fd *fd)
{
  800c6e:	f3 0f 1e fb          	endbr32 
  800c72:	55                   	push   %ebp
  800c73:	89 e5                	mov    %esp,%ebp
  800c75:	53                   	push   %ebx
  800c76:	83 ec 0c             	sub    $0xc,%esp
  800c79:	8b 5d 08             	mov    0x8(%ebp),%ebx
	(void) sys_page_unmap(0, fd);
  800c7c:	53                   	push   %ebx
  800c7d:	6a 00                	push   $0x0
  800c7f:	e8 a3 f5 ff ff       	call   800227 <sys_page_unmap>
	return sys_page_unmap(0, fd2data(fd));
  800c84:	89 1c 24             	mov    %ebx,(%esp)
  800c87:	e8 5a f7 ff ff       	call   8003e6 <fd2data>
  800c8c:	83 c4 08             	add    $0x8,%esp
  800c8f:	50                   	push   %eax
  800c90:	6a 00                	push   $0x0
  800c92:	e8 90 f5 ff ff       	call   800227 <sys_page_unmap>
}
  800c97:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  800c9a:	c9                   	leave  
  800c9b:	c3                   	ret    

00800c9c <_pipeisclosed>:
{
  800c9c:	55                   	push   %ebp
  800c9d:	89 e5                	mov    %esp,%ebp
  800c9f:	57                   	push   %edi
  800ca0:	56                   	push   %esi
  800ca1:	53                   	push   %ebx
  800ca2:	83 ec 1c             	sub    $0x1c,%esp
  800ca5:	89 c7                	mov    %eax,%edi
  800ca7:	89 d6                	mov    %edx,%esi
		n = thisenv->env_runs;
  800ca9:	a1 04 40 80 00       	mov    0x804004,%eax
  800cae:	8b 58 58             	mov    0x58(%eax),%ebx
		ret = pageref(fd) == pageref(p);
  800cb1:	83 ec 0c             	sub    $0xc,%esp
  800cb4:	57                   	push   %edi
  800cb5:	e8 1f 10 00 00       	call   801cd9 <pageref>
  800cba:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  800cbd:	89 34 24             	mov    %esi,(%esp)
  800cc0:	e8 14 10 00 00       	call   801cd9 <pageref>
		nn = thisenv->env_runs;
  800cc5:	8b 15 04 40 80 00    	mov    0x804004,%edx
  800ccb:	8b 4a 58             	mov    0x58(%edx),%ecx
		if (n == nn)
  800cce:	83 c4 10             	add    $0x10,%esp
  800cd1:	39 cb                	cmp    %ecx,%ebx
  800cd3:	74 1b                	je     800cf0 <_pipeisclosed+0x54>
		if (n != nn && ret == 1)
  800cd5:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  800cd8:	75 cf                	jne    800ca9 <_pipeisclosed+0xd>
			cprintf("pipe race avoided\n", n, thisenv->env_runs, ret);
  800cda:	8b 42 58             	mov    0x58(%edx),%eax
  800cdd:	6a 01                	push   $0x1
  800cdf:	50                   	push   %eax
  800ce0:	53                   	push   %ebx
  800ce1:	68 7e 20 80 00       	push   $0x80207e
  800ce6:	e8 13 05 00 00       	call   8011fe <cprintf>
  800ceb:	83 c4 10             	add    $0x10,%esp
  800cee:	eb b9                	jmp    800ca9 <_pipeisclosed+0xd>
		ret = pageref(fd) == pageref(p);
  800cf0:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  800cf3:	0f 94 c0             	sete   %al
  800cf6:	0f b6 c0             	movzbl %al,%eax
}
  800cf9:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800cfc:	5b                   	pop    %ebx
  800cfd:	5e                   	pop    %esi
  800cfe:	5f                   	pop    %edi
  800cff:	5d                   	pop    %ebp
  800d00:	c3                   	ret    

00800d01 <devpipe_write>:
{
  800d01:	f3 0f 1e fb          	endbr32 
  800d05:	55                   	push   %ebp
  800d06:	89 e5                	mov    %esp,%ebp
  800d08:	57                   	push   %edi
  800d09:	56                   	push   %esi
  800d0a:	53                   	push   %ebx
  800d0b:	83 ec 28             	sub    $0x28,%esp
  800d0e:	8b 75 08             	mov    0x8(%ebp),%esi
	p = (struct Pipe*) fd2data(fd);
  800d11:	56                   	push   %esi
  800d12:	e8 cf f6 ff ff       	call   8003e6 <fd2data>
  800d17:	89 c3                	mov    %eax,%ebx
	for (i = 0; i < n; i++) {
  800d19:	83 c4 10             	add    $0x10,%esp
  800d1c:	bf 00 00 00 00       	mov    $0x0,%edi
  800d21:	3b 7d 10             	cmp    0x10(%ebp),%edi
  800d24:	74 4f                	je     800d75 <devpipe_write+0x74>
		while (p->p_wpos >= p->p_rpos + sizeof(p->p_buf)) {
  800d26:	8b 43 04             	mov    0x4(%ebx),%eax
  800d29:	8b 0b                	mov    (%ebx),%ecx
  800d2b:	8d 51 20             	lea    0x20(%ecx),%edx
  800d2e:	39 d0                	cmp    %edx,%eax
  800d30:	72 14                	jb     800d46 <devpipe_write+0x45>
			if (_pipeisclosed(fd, p))
  800d32:	89 da                	mov    %ebx,%edx
  800d34:	89 f0                	mov    %esi,%eax
  800d36:	e8 61 ff ff ff       	call   800c9c <_pipeisclosed>
  800d3b:	85 c0                	test   %eax,%eax
  800d3d:	75 3b                	jne    800d7a <devpipe_write+0x79>
			sys_yield();
  800d3f:	e8 33 f4 ff ff       	call   800177 <sys_yield>
  800d44:	eb e0                	jmp    800d26 <devpipe_write+0x25>
		p->p_buf[p->p_wpos % PIPEBUFSIZ] = buf[i];
  800d46:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800d49:	0f b6 0c 39          	movzbl (%ecx,%edi,1),%ecx
  800d4d:	88 4d e7             	mov    %cl,-0x19(%ebp)
  800d50:	89 c2                	mov    %eax,%edx
  800d52:	c1 fa 1f             	sar    $0x1f,%edx
  800d55:	89 d1                	mov    %edx,%ecx
  800d57:	c1 e9 1b             	shr    $0x1b,%ecx
  800d5a:	8d 14 08             	lea    (%eax,%ecx,1),%edx
  800d5d:	83 e2 1f             	and    $0x1f,%edx
  800d60:	29 ca                	sub    %ecx,%edx
  800d62:	0f b6 4d e7          	movzbl -0x19(%ebp),%ecx
  800d66:	88 4c 13 08          	mov    %cl,0x8(%ebx,%edx,1)
		p->p_wpos++;
  800d6a:	83 c0 01             	add    $0x1,%eax
  800d6d:	89 43 04             	mov    %eax,0x4(%ebx)
	for (i = 0; i < n; i++) {
  800d70:	83 c7 01             	add    $0x1,%edi
  800d73:	eb ac                	jmp    800d21 <devpipe_write+0x20>
	return i;
  800d75:	8b 45 10             	mov    0x10(%ebp),%eax
  800d78:	eb 05                	jmp    800d7f <devpipe_write+0x7e>
				return 0;
  800d7a:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800d7f:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800d82:	5b                   	pop    %ebx
  800d83:	5e                   	pop    %esi
  800d84:	5f                   	pop    %edi
  800d85:	5d                   	pop    %ebp
  800d86:	c3                   	ret    

00800d87 <devpipe_read>:
{
  800d87:	f3 0f 1e fb          	endbr32 
  800d8b:	55                   	push   %ebp
  800d8c:	89 e5                	mov    %esp,%ebp
  800d8e:	57                   	push   %edi
  800d8f:	56                   	push   %esi
  800d90:	53                   	push   %ebx
  800d91:	83 ec 18             	sub    $0x18,%esp
  800d94:	8b 7d 08             	mov    0x8(%ebp),%edi
	p = (struct Pipe*)fd2data(fd);
  800d97:	57                   	push   %edi
  800d98:	e8 49 f6 ff ff       	call   8003e6 <fd2data>
  800d9d:	89 c3                	mov    %eax,%ebx
	for (i = 0; i < n; i++) {
  800d9f:	83 c4 10             	add    $0x10,%esp
  800da2:	be 00 00 00 00       	mov    $0x0,%esi
  800da7:	3b 75 10             	cmp    0x10(%ebp),%esi
  800daa:	75 14                	jne    800dc0 <devpipe_read+0x39>
	return i;
  800dac:	8b 45 10             	mov    0x10(%ebp),%eax
  800daf:	eb 02                	jmp    800db3 <devpipe_read+0x2c>
				return i;
  800db1:	89 f0                	mov    %esi,%eax
}
  800db3:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800db6:	5b                   	pop    %ebx
  800db7:	5e                   	pop    %esi
  800db8:	5f                   	pop    %edi
  800db9:	5d                   	pop    %ebp
  800dba:	c3                   	ret    
			sys_yield();
  800dbb:	e8 b7 f3 ff ff       	call   800177 <sys_yield>
		while (p->p_rpos == p->p_wpos) {
  800dc0:	8b 03                	mov    (%ebx),%eax
  800dc2:	3b 43 04             	cmp    0x4(%ebx),%eax
  800dc5:	75 18                	jne    800ddf <devpipe_read+0x58>
			if (i > 0)
  800dc7:	85 f6                	test   %esi,%esi
  800dc9:	75 e6                	jne    800db1 <devpipe_read+0x2a>
			if (_pipeisclosed(fd, p))
  800dcb:	89 da                	mov    %ebx,%edx
  800dcd:	89 f8                	mov    %edi,%eax
  800dcf:	e8 c8 fe ff ff       	call   800c9c <_pipeisclosed>
  800dd4:	85 c0                	test   %eax,%eax
  800dd6:	74 e3                	je     800dbb <devpipe_read+0x34>
				return 0;
  800dd8:	b8 00 00 00 00       	mov    $0x0,%eax
  800ddd:	eb d4                	jmp    800db3 <devpipe_read+0x2c>
		buf[i] = p->p_buf[p->p_rpos % PIPEBUFSIZ];
  800ddf:	99                   	cltd   
  800de0:	c1 ea 1b             	shr    $0x1b,%edx
  800de3:	01 d0                	add    %edx,%eax
  800de5:	83 e0 1f             	and    $0x1f,%eax
  800de8:	29 d0                	sub    %edx,%eax
  800dea:	0f b6 44 03 08       	movzbl 0x8(%ebx,%eax,1),%eax
  800def:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800df2:	88 04 31             	mov    %al,(%ecx,%esi,1)
		p->p_rpos++;
  800df5:	83 03 01             	addl   $0x1,(%ebx)
	for (i = 0; i < n; i++) {
  800df8:	83 c6 01             	add    $0x1,%esi
  800dfb:	eb aa                	jmp    800da7 <devpipe_read+0x20>

00800dfd <pipe>:
{
  800dfd:	f3 0f 1e fb          	endbr32 
  800e01:	55                   	push   %ebp
  800e02:	89 e5                	mov    %esp,%ebp
  800e04:	56                   	push   %esi
  800e05:	53                   	push   %ebx
  800e06:	83 ec 1c             	sub    $0x1c,%esp
	if ((r = fd_alloc(&fd0)) < 0
  800e09:	8d 45 f4             	lea    -0xc(%ebp),%eax
  800e0c:	50                   	push   %eax
  800e0d:	e8 ef f5 ff ff       	call   800401 <fd_alloc>
  800e12:	89 c3                	mov    %eax,%ebx
  800e14:	83 c4 10             	add    $0x10,%esp
  800e17:	85 c0                	test   %eax,%eax
  800e19:	0f 88 23 01 00 00    	js     800f42 <pipe+0x145>
	    || (r = sys_page_alloc(0, fd0, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  800e1f:	83 ec 04             	sub    $0x4,%esp
  800e22:	68 07 04 00 00       	push   $0x407
  800e27:	ff 75 f4             	pushl  -0xc(%ebp)
  800e2a:	6a 00                	push   $0x0
  800e2c:	e8 69 f3 ff ff       	call   80019a <sys_page_alloc>
  800e31:	89 c3                	mov    %eax,%ebx
  800e33:	83 c4 10             	add    $0x10,%esp
  800e36:	85 c0                	test   %eax,%eax
  800e38:	0f 88 04 01 00 00    	js     800f42 <pipe+0x145>
	if ((r = fd_alloc(&fd1)) < 0
  800e3e:	83 ec 0c             	sub    $0xc,%esp
  800e41:	8d 45 f0             	lea    -0x10(%ebp),%eax
  800e44:	50                   	push   %eax
  800e45:	e8 b7 f5 ff ff       	call   800401 <fd_alloc>
  800e4a:	89 c3                	mov    %eax,%ebx
  800e4c:	83 c4 10             	add    $0x10,%esp
  800e4f:	85 c0                	test   %eax,%eax
  800e51:	0f 88 db 00 00 00    	js     800f32 <pipe+0x135>
	    || (r = sys_page_alloc(0, fd1, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  800e57:	83 ec 04             	sub    $0x4,%esp
  800e5a:	68 07 04 00 00       	push   $0x407
  800e5f:	ff 75 f0             	pushl  -0x10(%ebp)
  800e62:	6a 00                	push   $0x0
  800e64:	e8 31 f3 ff ff       	call   80019a <sys_page_alloc>
  800e69:	89 c3                	mov    %eax,%ebx
  800e6b:	83 c4 10             	add    $0x10,%esp
  800e6e:	85 c0                	test   %eax,%eax
  800e70:	0f 88 bc 00 00 00    	js     800f32 <pipe+0x135>
	va = fd2data(fd0);
  800e76:	83 ec 0c             	sub    $0xc,%esp
  800e79:	ff 75 f4             	pushl  -0xc(%ebp)
  800e7c:	e8 65 f5 ff ff       	call   8003e6 <fd2data>
  800e81:	89 c6                	mov    %eax,%esi
	if ((r = sys_page_alloc(0, va, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  800e83:	83 c4 0c             	add    $0xc,%esp
  800e86:	68 07 04 00 00       	push   $0x407
  800e8b:	50                   	push   %eax
  800e8c:	6a 00                	push   $0x0
  800e8e:	e8 07 f3 ff ff       	call   80019a <sys_page_alloc>
  800e93:	89 c3                	mov    %eax,%ebx
  800e95:	83 c4 10             	add    $0x10,%esp
  800e98:	85 c0                	test   %eax,%eax
  800e9a:	0f 88 82 00 00 00    	js     800f22 <pipe+0x125>
	if ((r = sys_page_map(0, va, 0, fd2data(fd1), PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  800ea0:	83 ec 0c             	sub    $0xc,%esp
  800ea3:	ff 75 f0             	pushl  -0x10(%ebp)
  800ea6:	e8 3b f5 ff ff       	call   8003e6 <fd2data>
  800eab:	c7 04 24 07 04 00 00 	movl   $0x407,(%esp)
  800eb2:	50                   	push   %eax
  800eb3:	6a 00                	push   $0x0
  800eb5:	56                   	push   %esi
  800eb6:	6a 00                	push   $0x0
  800eb8:	e8 24 f3 ff ff       	call   8001e1 <sys_page_map>
  800ebd:	89 c3                	mov    %eax,%ebx
  800ebf:	83 c4 20             	add    $0x20,%esp
  800ec2:	85 c0                	test   %eax,%eax
  800ec4:	78 4e                	js     800f14 <pipe+0x117>
	fd0->fd_dev_id = devpipe.dev_id;
  800ec6:	a1 20 30 80 00       	mov    0x803020,%eax
  800ecb:	8b 55 f4             	mov    -0xc(%ebp),%edx
  800ece:	89 02                	mov    %eax,(%edx)
	fd0->fd_omode = O_RDONLY;
  800ed0:	8b 55 f4             	mov    -0xc(%ebp),%edx
  800ed3:	c7 42 08 00 00 00 00 	movl   $0x0,0x8(%edx)
	fd1->fd_dev_id = devpipe.dev_id;
  800eda:	8b 55 f0             	mov    -0x10(%ebp),%edx
  800edd:	89 02                	mov    %eax,(%edx)
	fd1->fd_omode = O_WRONLY;
  800edf:	8b 45 f0             	mov    -0x10(%ebp),%eax
  800ee2:	c7 40 08 01 00 00 00 	movl   $0x1,0x8(%eax)
	pfd[0] = fd2num(fd0);
  800ee9:	83 ec 0c             	sub    $0xc,%esp
  800eec:	ff 75 f4             	pushl  -0xc(%ebp)
  800eef:	e8 de f4 ff ff       	call   8003d2 <fd2num>
  800ef4:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800ef7:	89 01                	mov    %eax,(%ecx)
	pfd[1] = fd2num(fd1);
  800ef9:	83 c4 04             	add    $0x4,%esp
  800efc:	ff 75 f0             	pushl  -0x10(%ebp)
  800eff:	e8 ce f4 ff ff       	call   8003d2 <fd2num>
  800f04:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800f07:	89 41 04             	mov    %eax,0x4(%ecx)
	return 0;
  800f0a:	83 c4 10             	add    $0x10,%esp
  800f0d:	bb 00 00 00 00       	mov    $0x0,%ebx
  800f12:	eb 2e                	jmp    800f42 <pipe+0x145>
	sys_page_unmap(0, va);
  800f14:	83 ec 08             	sub    $0x8,%esp
  800f17:	56                   	push   %esi
  800f18:	6a 00                	push   $0x0
  800f1a:	e8 08 f3 ff ff       	call   800227 <sys_page_unmap>
  800f1f:	83 c4 10             	add    $0x10,%esp
	sys_page_unmap(0, fd1);
  800f22:	83 ec 08             	sub    $0x8,%esp
  800f25:	ff 75 f0             	pushl  -0x10(%ebp)
  800f28:	6a 00                	push   $0x0
  800f2a:	e8 f8 f2 ff ff       	call   800227 <sys_page_unmap>
  800f2f:	83 c4 10             	add    $0x10,%esp
	sys_page_unmap(0, fd0);
  800f32:	83 ec 08             	sub    $0x8,%esp
  800f35:	ff 75 f4             	pushl  -0xc(%ebp)
  800f38:	6a 00                	push   $0x0
  800f3a:	e8 e8 f2 ff ff       	call   800227 <sys_page_unmap>
  800f3f:	83 c4 10             	add    $0x10,%esp
}
  800f42:	89 d8                	mov    %ebx,%eax
  800f44:	8d 65 f8             	lea    -0x8(%ebp),%esp
  800f47:	5b                   	pop    %ebx
  800f48:	5e                   	pop    %esi
  800f49:	5d                   	pop    %ebp
  800f4a:	c3                   	ret    

00800f4b <pipeisclosed>:
{
  800f4b:	f3 0f 1e fb          	endbr32 
  800f4f:	55                   	push   %ebp
  800f50:	89 e5                	mov    %esp,%ebp
  800f52:	83 ec 20             	sub    $0x20,%esp
	if ((r = fd_lookup(fdnum, &fd)) < 0)
  800f55:	8d 45 f4             	lea    -0xc(%ebp),%eax
  800f58:	50                   	push   %eax
  800f59:	ff 75 08             	pushl  0x8(%ebp)
  800f5c:	e8 f6 f4 ff ff       	call   800457 <fd_lookup>
  800f61:	83 c4 10             	add    $0x10,%esp
  800f64:	85 c0                	test   %eax,%eax
  800f66:	78 18                	js     800f80 <pipeisclosed+0x35>
	p = (struct Pipe*) fd2data(fd);
  800f68:	83 ec 0c             	sub    $0xc,%esp
  800f6b:	ff 75 f4             	pushl  -0xc(%ebp)
  800f6e:	e8 73 f4 ff ff       	call   8003e6 <fd2data>
  800f73:	89 c2                	mov    %eax,%edx
	return _pipeisclosed(fd, p);
  800f75:	8b 45 f4             	mov    -0xc(%ebp),%eax
  800f78:	e8 1f fd ff ff       	call   800c9c <_pipeisclosed>
  800f7d:	83 c4 10             	add    $0x10,%esp
}
  800f80:	c9                   	leave  
  800f81:	c3                   	ret    

00800f82 <devcons_close>:
	return tot;
}

static int
devcons_close(struct Fd *fd)
{
  800f82:	f3 0f 1e fb          	endbr32 
	USED(fd);

	return 0;
}
  800f86:	b8 00 00 00 00       	mov    $0x0,%eax
  800f8b:	c3                   	ret    

00800f8c <devcons_stat>:

static int
devcons_stat(struct Fd *fd, struct Stat *stat)
{
  800f8c:	f3 0f 1e fb          	endbr32 
  800f90:	55                   	push   %ebp
  800f91:	89 e5                	mov    %esp,%ebp
  800f93:	83 ec 10             	sub    $0x10,%esp
	strcpy(stat->st_name, "<cons>");
  800f96:	68 96 20 80 00       	push   $0x802096
  800f9b:	ff 75 0c             	pushl  0xc(%ebp)
  800f9e:	e8 34 08 00 00       	call   8017d7 <strcpy>
	return 0;
}
  800fa3:	b8 00 00 00 00       	mov    $0x0,%eax
  800fa8:	c9                   	leave  
  800fa9:	c3                   	ret    

00800faa <devcons_write>:
{
  800faa:	f3 0f 1e fb          	endbr32 
  800fae:	55                   	push   %ebp
  800faf:	89 e5                	mov    %esp,%ebp
  800fb1:	57                   	push   %edi
  800fb2:	56                   	push   %esi
  800fb3:	53                   	push   %ebx
  800fb4:	81 ec 8c 00 00 00    	sub    $0x8c,%esp
	for (tot = 0; tot < n; tot += m) {
  800fba:	be 00 00 00 00       	mov    $0x0,%esi
		memmove(buf, (char*)vbuf + tot, m);
  800fbf:	8d bd 68 ff ff ff    	lea    -0x98(%ebp),%edi
	for (tot = 0; tot < n; tot += m) {
  800fc5:	3b 75 10             	cmp    0x10(%ebp),%esi
  800fc8:	73 31                	jae    800ffb <devcons_write+0x51>
		m = n - tot;
  800fca:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800fcd:	29 f3                	sub    %esi,%ebx
  800fcf:	83 fb 7f             	cmp    $0x7f,%ebx
  800fd2:	b8 7f 00 00 00       	mov    $0x7f,%eax
  800fd7:	0f 47 d8             	cmova  %eax,%ebx
		memmove(buf, (char*)vbuf + tot, m);
  800fda:	83 ec 04             	sub    $0x4,%esp
  800fdd:	53                   	push   %ebx
  800fde:	89 f0                	mov    %esi,%eax
  800fe0:	03 45 0c             	add    0xc(%ebp),%eax
  800fe3:	50                   	push   %eax
  800fe4:	57                   	push   %edi
  800fe5:	e8 a3 09 00 00       	call   80198d <memmove>
		sys_cputs(buf, m);
  800fea:	83 c4 08             	add    $0x8,%esp
  800fed:	53                   	push   %ebx
  800fee:	57                   	push   %edi
  800fef:	e8 d6 f0 ff ff       	call   8000ca <sys_cputs>
	for (tot = 0; tot < n; tot += m) {
  800ff4:	01 de                	add    %ebx,%esi
  800ff6:	83 c4 10             	add    $0x10,%esp
  800ff9:	eb ca                	jmp    800fc5 <devcons_write+0x1b>
}
  800ffb:	89 f0                	mov    %esi,%eax
  800ffd:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801000:	5b                   	pop    %ebx
  801001:	5e                   	pop    %esi
  801002:	5f                   	pop    %edi
  801003:	5d                   	pop    %ebp
  801004:	c3                   	ret    

00801005 <devcons_read>:
{
  801005:	f3 0f 1e fb          	endbr32 
  801009:	55                   	push   %ebp
  80100a:	89 e5                	mov    %esp,%ebp
  80100c:	83 ec 08             	sub    $0x8,%esp
  80100f:	b8 00 00 00 00       	mov    $0x0,%eax
	if (n == 0)
  801014:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  801018:	74 21                	je     80103b <devcons_read+0x36>
	while ((c = sys_cgetc()) == 0)
  80101a:	e8 cd f0 ff ff       	call   8000ec <sys_cgetc>
  80101f:	85 c0                	test   %eax,%eax
  801021:	75 07                	jne    80102a <devcons_read+0x25>
		sys_yield();
  801023:	e8 4f f1 ff ff       	call   800177 <sys_yield>
  801028:	eb f0                	jmp    80101a <devcons_read+0x15>
	if (c < 0)
  80102a:	78 0f                	js     80103b <devcons_read+0x36>
	if (c == 0x04)	// ctl-d is eof
  80102c:	83 f8 04             	cmp    $0x4,%eax
  80102f:	74 0c                	je     80103d <devcons_read+0x38>
	*(char*)vbuf = c;
  801031:	8b 55 0c             	mov    0xc(%ebp),%edx
  801034:	88 02                	mov    %al,(%edx)
	return 1;
  801036:	b8 01 00 00 00       	mov    $0x1,%eax
}
  80103b:	c9                   	leave  
  80103c:	c3                   	ret    
		return 0;
  80103d:	b8 00 00 00 00       	mov    $0x0,%eax
  801042:	eb f7                	jmp    80103b <devcons_read+0x36>

00801044 <cputchar>:
{
  801044:	f3 0f 1e fb          	endbr32 
  801048:	55                   	push   %ebp
  801049:	89 e5                	mov    %esp,%ebp
  80104b:	83 ec 20             	sub    $0x20,%esp
	char c = ch;
  80104e:	8b 45 08             	mov    0x8(%ebp),%eax
  801051:	88 45 f7             	mov    %al,-0x9(%ebp)
	sys_cputs(&c, 1);
  801054:	6a 01                	push   $0x1
  801056:	8d 45 f7             	lea    -0x9(%ebp),%eax
  801059:	50                   	push   %eax
  80105a:	e8 6b f0 ff ff       	call   8000ca <sys_cputs>
}
  80105f:	83 c4 10             	add    $0x10,%esp
  801062:	c9                   	leave  
  801063:	c3                   	ret    

00801064 <getchar>:
{
  801064:	f3 0f 1e fb          	endbr32 
  801068:	55                   	push   %ebp
  801069:	89 e5                	mov    %esp,%ebp
  80106b:	83 ec 1c             	sub    $0x1c,%esp
	r = read(0, &c, 1);
  80106e:	6a 01                	push   $0x1
  801070:	8d 45 f7             	lea    -0x9(%ebp),%eax
  801073:	50                   	push   %eax
  801074:	6a 00                	push   $0x0
  801076:	e8 5f f6 ff ff       	call   8006da <read>
	if (r < 0)
  80107b:	83 c4 10             	add    $0x10,%esp
  80107e:	85 c0                	test   %eax,%eax
  801080:	78 06                	js     801088 <getchar+0x24>
	if (r < 1)
  801082:	74 06                	je     80108a <getchar+0x26>
	return c;
  801084:	0f b6 45 f7          	movzbl -0x9(%ebp),%eax
}
  801088:	c9                   	leave  
  801089:	c3                   	ret    
		return -E_EOF;
  80108a:	b8 f8 ff ff ff       	mov    $0xfffffff8,%eax
  80108f:	eb f7                	jmp    801088 <getchar+0x24>

00801091 <iscons>:
{
  801091:	f3 0f 1e fb          	endbr32 
  801095:	55                   	push   %ebp
  801096:	89 e5                	mov    %esp,%ebp
  801098:	83 ec 20             	sub    $0x20,%esp
	if ((r = fd_lookup(fdnum, &fd)) < 0)
  80109b:	8d 45 f4             	lea    -0xc(%ebp),%eax
  80109e:	50                   	push   %eax
  80109f:	ff 75 08             	pushl  0x8(%ebp)
  8010a2:	e8 b0 f3 ff ff       	call   800457 <fd_lookup>
  8010a7:	83 c4 10             	add    $0x10,%esp
  8010aa:	85 c0                	test   %eax,%eax
  8010ac:	78 11                	js     8010bf <iscons+0x2e>
	return fd->fd_dev_id == devcons.dev_id;
  8010ae:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8010b1:	8b 15 3c 30 80 00    	mov    0x80303c,%edx
  8010b7:	39 10                	cmp    %edx,(%eax)
  8010b9:	0f 94 c0             	sete   %al
  8010bc:	0f b6 c0             	movzbl %al,%eax
}
  8010bf:	c9                   	leave  
  8010c0:	c3                   	ret    

008010c1 <opencons>:
{
  8010c1:	f3 0f 1e fb          	endbr32 
  8010c5:	55                   	push   %ebp
  8010c6:	89 e5                	mov    %esp,%ebp
  8010c8:	83 ec 24             	sub    $0x24,%esp
	if ((r = fd_alloc(&fd)) < 0)
  8010cb:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8010ce:	50                   	push   %eax
  8010cf:	e8 2d f3 ff ff       	call   800401 <fd_alloc>
  8010d4:	83 c4 10             	add    $0x10,%esp
  8010d7:	85 c0                	test   %eax,%eax
  8010d9:	78 3a                	js     801115 <opencons+0x54>
	if ((r = sys_page_alloc(0, fd, PTE_P|PTE_U|PTE_W|PTE_SHARE)) < 0)
  8010db:	83 ec 04             	sub    $0x4,%esp
  8010de:	68 07 04 00 00       	push   $0x407
  8010e3:	ff 75 f4             	pushl  -0xc(%ebp)
  8010e6:	6a 00                	push   $0x0
  8010e8:	e8 ad f0 ff ff       	call   80019a <sys_page_alloc>
  8010ed:	83 c4 10             	add    $0x10,%esp
  8010f0:	85 c0                	test   %eax,%eax
  8010f2:	78 21                	js     801115 <opencons+0x54>
	fd->fd_dev_id = devcons.dev_id;
  8010f4:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8010f7:	8b 15 3c 30 80 00    	mov    0x80303c,%edx
  8010fd:	89 10                	mov    %edx,(%eax)
	fd->fd_omode = O_RDWR;
  8010ff:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801102:	c7 40 08 02 00 00 00 	movl   $0x2,0x8(%eax)
	return fd2num(fd);
  801109:	83 ec 0c             	sub    $0xc,%esp
  80110c:	50                   	push   %eax
  80110d:	e8 c0 f2 ff ff       	call   8003d2 <fd2num>
  801112:	83 c4 10             	add    $0x10,%esp
}
  801115:	c9                   	leave  
  801116:	c3                   	ret    

00801117 <_panic>:
 * It prints "panic: <message>", then causes a breakpoint exception,
 * which causes JOS to enter the JOS kernel monitor.
 */
void
_panic(const char *file, int line, const char *fmt, ...)
{
  801117:	f3 0f 1e fb          	endbr32 
  80111b:	55                   	push   %ebp
  80111c:	89 e5                	mov    %esp,%ebp
  80111e:	56                   	push   %esi
  80111f:	53                   	push   %ebx
	va_list ap;

	va_start(ap, fmt);
  801120:	8d 5d 14             	lea    0x14(%ebp),%ebx

	// Print the panic message
	cprintf("[%08x] user panic in %s at %s:%d: ",
  801123:	8b 35 00 30 80 00    	mov    0x803000,%esi
  801129:	e8 26 f0 ff ff       	call   800154 <sys_getenvid>
  80112e:	83 ec 0c             	sub    $0xc,%esp
  801131:	ff 75 0c             	pushl  0xc(%ebp)
  801134:	ff 75 08             	pushl  0x8(%ebp)
  801137:	56                   	push   %esi
  801138:	50                   	push   %eax
  801139:	68 a4 20 80 00       	push   $0x8020a4
  80113e:	e8 bb 00 00 00       	call   8011fe <cprintf>
		sys_getenvid(), binaryname, file, line);
	vcprintf(fmt, ap);
  801143:	83 c4 18             	add    $0x18,%esp
  801146:	53                   	push   %ebx
  801147:	ff 75 10             	pushl  0x10(%ebp)
  80114a:	e8 5a 00 00 00       	call   8011a9 <vcprintf>
	cprintf("\n");
  80114f:	c7 04 24 8f 20 80 00 	movl   $0x80208f,(%esp)
  801156:	e8 a3 00 00 00       	call   8011fe <cprintf>
  80115b:	83 c4 10             	add    $0x10,%esp

	// Cause a breakpoint exception
	while (1)
		asm volatile("int3");
  80115e:	cc                   	int3   
  80115f:	eb fd                	jmp    80115e <_panic+0x47>

00801161 <putch>:
};


static void
putch(int ch, struct printbuf *b)
{
  801161:	f3 0f 1e fb          	endbr32 
  801165:	55                   	push   %ebp
  801166:	89 e5                	mov    %esp,%ebp
  801168:	53                   	push   %ebx
  801169:	83 ec 04             	sub    $0x4,%esp
  80116c:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	b->buf[b->idx++] = ch;
  80116f:	8b 13                	mov    (%ebx),%edx
  801171:	8d 42 01             	lea    0x1(%edx),%eax
  801174:	89 03                	mov    %eax,(%ebx)
  801176:	8b 4d 08             	mov    0x8(%ebp),%ecx
  801179:	88 4c 13 08          	mov    %cl,0x8(%ebx,%edx,1)
	if (b->idx == 256-1) {
  80117d:	3d ff 00 00 00       	cmp    $0xff,%eax
  801182:	74 09                	je     80118d <putch+0x2c>
		sys_cputs(b->buf, b->idx);
		b->idx = 0;
	}
	b->cnt++;
  801184:	83 43 04 01          	addl   $0x1,0x4(%ebx)
}
  801188:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  80118b:	c9                   	leave  
  80118c:	c3                   	ret    
		sys_cputs(b->buf, b->idx);
  80118d:	83 ec 08             	sub    $0x8,%esp
  801190:	68 ff 00 00 00       	push   $0xff
  801195:	8d 43 08             	lea    0x8(%ebx),%eax
  801198:	50                   	push   %eax
  801199:	e8 2c ef ff ff       	call   8000ca <sys_cputs>
		b->idx = 0;
  80119e:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  8011a4:	83 c4 10             	add    $0x10,%esp
  8011a7:	eb db                	jmp    801184 <putch+0x23>

008011a9 <vcprintf>:

int
vcprintf(const char *fmt, va_list ap)
{
  8011a9:	f3 0f 1e fb          	endbr32 
  8011ad:	55                   	push   %ebp
  8011ae:	89 e5                	mov    %esp,%ebp
  8011b0:	81 ec 18 01 00 00    	sub    $0x118,%esp
	struct printbuf b;

	b.idx = 0;
  8011b6:	c7 85 f0 fe ff ff 00 	movl   $0x0,-0x110(%ebp)
  8011bd:	00 00 00 
	b.cnt = 0;
  8011c0:	c7 85 f4 fe ff ff 00 	movl   $0x0,-0x10c(%ebp)
  8011c7:	00 00 00 
	vprintfmt((void*)putch, &b, fmt, ap);
  8011ca:	ff 75 0c             	pushl  0xc(%ebp)
  8011cd:	ff 75 08             	pushl  0x8(%ebp)
  8011d0:	8d 85 f0 fe ff ff    	lea    -0x110(%ebp),%eax
  8011d6:	50                   	push   %eax
  8011d7:	68 61 11 80 00       	push   $0x801161
  8011dc:	e8 20 01 00 00       	call   801301 <vprintfmt>
	sys_cputs(b.buf, b.idx);
  8011e1:	83 c4 08             	add    $0x8,%esp
  8011e4:	ff b5 f0 fe ff ff    	pushl  -0x110(%ebp)
  8011ea:	8d 85 f8 fe ff ff    	lea    -0x108(%ebp),%eax
  8011f0:	50                   	push   %eax
  8011f1:	e8 d4 ee ff ff       	call   8000ca <sys_cputs>

	return b.cnt;
}
  8011f6:	8b 85 f4 fe ff ff    	mov    -0x10c(%ebp),%eax
  8011fc:	c9                   	leave  
  8011fd:	c3                   	ret    

008011fe <cprintf>:

int
cprintf(const char *fmt, ...)
{
  8011fe:	f3 0f 1e fb          	endbr32 
  801202:	55                   	push   %ebp
  801203:	89 e5                	mov    %esp,%ebp
  801205:	83 ec 10             	sub    $0x10,%esp
	va_list ap;
	int cnt;

	va_start(ap, fmt);
  801208:	8d 45 0c             	lea    0xc(%ebp),%eax
	cnt = vcprintf(fmt, ap);
  80120b:	50                   	push   %eax
  80120c:	ff 75 08             	pushl  0x8(%ebp)
  80120f:	e8 95 ff ff ff       	call   8011a9 <vcprintf>
	va_end(ap);

	return cnt;
}
  801214:	c9                   	leave  
  801215:	c3                   	ret    

00801216 <printnum>:
 * using specified putch function and associated pointer putdat.
 */
static void
printnum(void (*putch)(int, void*), void *putdat,
	 unsigned long long num, unsigned base, int width, int padc)
{
  801216:	55                   	push   %ebp
  801217:	89 e5                	mov    %esp,%ebp
  801219:	57                   	push   %edi
  80121a:	56                   	push   %esi
  80121b:	53                   	push   %ebx
  80121c:	83 ec 1c             	sub    $0x1c,%esp
  80121f:	89 c7                	mov    %eax,%edi
  801221:	89 d6                	mov    %edx,%esi
  801223:	8b 45 08             	mov    0x8(%ebp),%eax
  801226:	8b 55 0c             	mov    0xc(%ebp),%edx
  801229:	89 d1                	mov    %edx,%ecx
  80122b:	89 c2                	mov    %eax,%edx
  80122d:	89 45 d8             	mov    %eax,-0x28(%ebp)
  801230:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  801233:	8b 45 10             	mov    0x10(%ebp),%eax
  801236:	8b 5d 14             	mov    0x14(%ebp),%ebx
	// first recursively print all preceding (more significant) digits
	if (num >= base) {
  801239:	89 45 e0             	mov    %eax,-0x20(%ebp)
  80123c:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
  801243:	39 c2                	cmp    %eax,%edx
  801245:	1b 4d e4             	sbb    -0x1c(%ebp),%ecx
  801248:	72 3e                	jb     801288 <printnum+0x72>
		printnum(putch, putdat, num / base, base, width - 1, padc);
  80124a:	83 ec 0c             	sub    $0xc,%esp
  80124d:	ff 75 18             	pushl  0x18(%ebp)
  801250:	83 eb 01             	sub    $0x1,%ebx
  801253:	53                   	push   %ebx
  801254:	50                   	push   %eax
  801255:	83 ec 08             	sub    $0x8,%esp
  801258:	ff 75 e4             	pushl  -0x1c(%ebp)
  80125b:	ff 75 e0             	pushl  -0x20(%ebp)
  80125e:	ff 75 dc             	pushl  -0x24(%ebp)
  801261:	ff 75 d8             	pushl  -0x28(%ebp)
  801264:	e8 b7 0a 00 00       	call   801d20 <__udivdi3>
  801269:	83 c4 18             	add    $0x18,%esp
  80126c:	52                   	push   %edx
  80126d:	50                   	push   %eax
  80126e:	89 f2                	mov    %esi,%edx
  801270:	89 f8                	mov    %edi,%eax
  801272:	e8 9f ff ff ff       	call   801216 <printnum>
  801277:	83 c4 20             	add    $0x20,%esp
  80127a:	eb 13                	jmp    80128f <printnum+0x79>
	} else {
		// print any needed pad characters before first digit
		while (--width > 0)
			putch(padc, putdat);
  80127c:	83 ec 08             	sub    $0x8,%esp
  80127f:	56                   	push   %esi
  801280:	ff 75 18             	pushl  0x18(%ebp)
  801283:	ff d7                	call   *%edi
  801285:	83 c4 10             	add    $0x10,%esp
		while (--width > 0)
  801288:	83 eb 01             	sub    $0x1,%ebx
  80128b:	85 db                	test   %ebx,%ebx
  80128d:	7f ed                	jg     80127c <printnum+0x66>
	}

	// then print this (the least significant) digit
	putch("0123456789abcdef"[num % base], putdat);
  80128f:	83 ec 08             	sub    $0x8,%esp
  801292:	56                   	push   %esi
  801293:	83 ec 04             	sub    $0x4,%esp
  801296:	ff 75 e4             	pushl  -0x1c(%ebp)
  801299:	ff 75 e0             	pushl  -0x20(%ebp)
  80129c:	ff 75 dc             	pushl  -0x24(%ebp)
  80129f:	ff 75 d8             	pushl  -0x28(%ebp)
  8012a2:	e8 89 0b 00 00       	call   801e30 <__umoddi3>
  8012a7:	83 c4 14             	add    $0x14,%esp
  8012aa:	0f be 80 c7 20 80 00 	movsbl 0x8020c7(%eax),%eax
  8012b1:	50                   	push   %eax
  8012b2:	ff d7                	call   *%edi
}
  8012b4:	83 c4 10             	add    $0x10,%esp
  8012b7:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8012ba:	5b                   	pop    %ebx
  8012bb:	5e                   	pop    %esi
  8012bc:	5f                   	pop    %edi
  8012bd:	5d                   	pop    %ebp
  8012be:	c3                   	ret    

008012bf <sprintputch>:
	int cnt;
};

static void
sprintputch(int ch, struct sprintbuf *b)
{
  8012bf:	f3 0f 1e fb          	endbr32 
  8012c3:	55                   	push   %ebp
  8012c4:	89 e5                	mov    %esp,%ebp
  8012c6:	8b 45 0c             	mov    0xc(%ebp),%eax
	b->cnt++;
  8012c9:	83 40 08 01          	addl   $0x1,0x8(%eax)
	if (b->buf < b->ebuf)
  8012cd:	8b 10                	mov    (%eax),%edx
  8012cf:	3b 50 04             	cmp    0x4(%eax),%edx
  8012d2:	73 0a                	jae    8012de <sprintputch+0x1f>
		*b->buf++ = ch;
  8012d4:	8d 4a 01             	lea    0x1(%edx),%ecx
  8012d7:	89 08                	mov    %ecx,(%eax)
  8012d9:	8b 45 08             	mov    0x8(%ebp),%eax
  8012dc:	88 02                	mov    %al,(%edx)
}
  8012de:	5d                   	pop    %ebp
  8012df:	c3                   	ret    

008012e0 <printfmt>:
{
  8012e0:	f3 0f 1e fb          	endbr32 
  8012e4:	55                   	push   %ebp
  8012e5:	89 e5                	mov    %esp,%ebp
  8012e7:	83 ec 08             	sub    $0x8,%esp
	va_start(ap, fmt);
  8012ea:	8d 45 14             	lea    0x14(%ebp),%eax
	vprintfmt(putch, putdat, fmt, ap);
  8012ed:	50                   	push   %eax
  8012ee:	ff 75 10             	pushl  0x10(%ebp)
  8012f1:	ff 75 0c             	pushl  0xc(%ebp)
  8012f4:	ff 75 08             	pushl  0x8(%ebp)
  8012f7:	e8 05 00 00 00       	call   801301 <vprintfmt>
}
  8012fc:	83 c4 10             	add    $0x10,%esp
  8012ff:	c9                   	leave  
  801300:	c3                   	ret    

00801301 <vprintfmt>:
{
  801301:	f3 0f 1e fb          	endbr32 
  801305:	55                   	push   %ebp
  801306:	89 e5                	mov    %esp,%ebp
  801308:	57                   	push   %edi
  801309:	56                   	push   %esi
  80130a:	53                   	push   %ebx
  80130b:	83 ec 3c             	sub    $0x3c,%esp
  80130e:	8b 75 08             	mov    0x8(%ebp),%esi
  801311:	8b 5d 0c             	mov    0xc(%ebp),%ebx
  801314:	8b 7d 10             	mov    0x10(%ebp),%edi
  801317:	e9 5d 03 00 00       	jmp    801679 <vprintfmt+0x378>
		padc = ' ';
  80131c:	c6 45 d3 20          	movb   $0x20,-0x2d(%ebp)
		altflag = 0;
  801320:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
		precision = -1;
  801327:	c7 45 d8 ff ff ff ff 	movl   $0xffffffff,-0x28(%ebp)
		width = -1;
  80132e:	c7 45 d4 ff ff ff ff 	movl   $0xffffffff,-0x2c(%ebp)
		lflag = 0;
  801335:	b9 00 00 00 00       	mov    $0x0,%ecx
		switch (ch = *(unsigned char *) fmt++) {
  80133a:	8d 47 01             	lea    0x1(%edi),%eax
  80133d:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  801340:	0f b6 17             	movzbl (%edi),%edx
  801343:	8d 42 dd             	lea    -0x23(%edx),%eax
  801346:	3c 55                	cmp    $0x55,%al
  801348:	0f 87 ae 03 00 00    	ja     8016fc <vprintfmt+0x3fb>
  80134e:	0f b6 c0             	movzbl %al,%eax
  801351:	3e ff 24 85 00 22 80 	notrack jmp *0x802200(,%eax,4)
  801358:	00 
  801359:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			padc = '-';
  80135c:	c6 45 d3 2d          	movb   $0x2d,-0x2d(%ebp)
  801360:	eb d8                	jmp    80133a <vprintfmt+0x39>
		switch (ch = *(unsigned char *) fmt++) {
  801362:	8b 7d e4             	mov    -0x1c(%ebp),%edi
  801365:	c6 45 d3 30          	movb   $0x30,-0x2d(%ebp)
  801369:	eb cf                	jmp    80133a <vprintfmt+0x39>
  80136b:	0f b6 d2             	movzbl %dl,%edx
  80136e:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			for (precision = 0; ; ++fmt) {
  801371:	b8 00 00 00 00       	mov    $0x0,%eax
  801376:	89 4d e4             	mov    %ecx,-0x1c(%ebp)
				precision = precision * 10 + ch - '0';
  801379:	8d 04 80             	lea    (%eax,%eax,4),%eax
  80137c:	8d 44 42 d0          	lea    -0x30(%edx,%eax,2),%eax
				ch = *fmt;
  801380:	0f be 17             	movsbl (%edi),%edx
				if (ch < '0' || ch > '9')
  801383:	8d 4a d0             	lea    -0x30(%edx),%ecx
  801386:	83 f9 09             	cmp    $0x9,%ecx
  801389:	77 55                	ja     8013e0 <vprintfmt+0xdf>
			for (precision = 0; ; ++fmt) {
  80138b:	83 c7 01             	add    $0x1,%edi
				precision = precision * 10 + ch - '0';
  80138e:	eb e9                	jmp    801379 <vprintfmt+0x78>
			precision = va_arg(ap, int);
  801390:	8b 45 14             	mov    0x14(%ebp),%eax
  801393:	8b 00                	mov    (%eax),%eax
  801395:	89 45 d8             	mov    %eax,-0x28(%ebp)
  801398:	8b 45 14             	mov    0x14(%ebp),%eax
  80139b:	8d 40 04             	lea    0x4(%eax),%eax
  80139e:	89 45 14             	mov    %eax,0x14(%ebp)
		switch (ch = *(unsigned char *) fmt++) {
  8013a1:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			if (width < 0)
  8013a4:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  8013a8:	79 90                	jns    80133a <vprintfmt+0x39>
				width = precision, precision = -1;
  8013aa:	8b 45 d8             	mov    -0x28(%ebp),%eax
  8013ad:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  8013b0:	c7 45 d8 ff ff ff ff 	movl   $0xffffffff,-0x28(%ebp)
  8013b7:	eb 81                	jmp    80133a <vprintfmt+0x39>
  8013b9:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  8013bc:	85 c0                	test   %eax,%eax
  8013be:	ba 00 00 00 00       	mov    $0x0,%edx
  8013c3:	0f 49 d0             	cmovns %eax,%edx
  8013c6:	89 55 d4             	mov    %edx,-0x2c(%ebp)
		switch (ch = *(unsigned char *) fmt++) {
  8013c9:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			goto reswitch;
  8013cc:	e9 69 ff ff ff       	jmp    80133a <vprintfmt+0x39>
		switch (ch = *(unsigned char *) fmt++) {
  8013d1:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			altflag = 1;
  8013d4:	c7 45 e0 01 00 00 00 	movl   $0x1,-0x20(%ebp)
			goto reswitch;
  8013db:	e9 5a ff ff ff       	jmp    80133a <vprintfmt+0x39>
  8013e0:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
  8013e3:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8013e6:	eb bc                	jmp    8013a4 <vprintfmt+0xa3>
			lflag++;
  8013e8:	83 c1 01             	add    $0x1,%ecx
		switch (ch = *(unsigned char *) fmt++) {
  8013eb:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			goto reswitch;
  8013ee:	e9 47 ff ff ff       	jmp    80133a <vprintfmt+0x39>
			putch(va_arg(ap, int), putdat);
  8013f3:	8b 45 14             	mov    0x14(%ebp),%eax
  8013f6:	8d 78 04             	lea    0x4(%eax),%edi
  8013f9:	83 ec 08             	sub    $0x8,%esp
  8013fc:	53                   	push   %ebx
  8013fd:	ff 30                	pushl  (%eax)
  8013ff:	ff d6                	call   *%esi
			break;
  801401:	83 c4 10             	add    $0x10,%esp
			putch(va_arg(ap, int), putdat);
  801404:	89 7d 14             	mov    %edi,0x14(%ebp)
			break;
  801407:	e9 6a 02 00 00       	jmp    801676 <vprintfmt+0x375>
			err = va_arg(ap, int);
  80140c:	8b 45 14             	mov    0x14(%ebp),%eax
  80140f:	8d 78 04             	lea    0x4(%eax),%edi
  801412:	8b 00                	mov    (%eax),%eax
  801414:	99                   	cltd   
  801415:	31 d0                	xor    %edx,%eax
  801417:	29 d0                	sub    %edx,%eax
			if (err >= MAXERROR || (p = error_string[err]) == NULL)
  801419:	83 f8 0f             	cmp    $0xf,%eax
  80141c:	7f 23                	jg     801441 <vprintfmt+0x140>
  80141e:	8b 14 85 60 23 80 00 	mov    0x802360(,%eax,4),%edx
  801425:	85 d2                	test   %edx,%edx
  801427:	74 18                	je     801441 <vprintfmt+0x140>
				printfmt(putch, putdat, "%s", p);
  801429:	52                   	push   %edx
  80142a:	68 5d 20 80 00       	push   $0x80205d
  80142f:	53                   	push   %ebx
  801430:	56                   	push   %esi
  801431:	e8 aa fe ff ff       	call   8012e0 <printfmt>
  801436:	83 c4 10             	add    $0x10,%esp
			err = va_arg(ap, int);
  801439:	89 7d 14             	mov    %edi,0x14(%ebp)
  80143c:	e9 35 02 00 00       	jmp    801676 <vprintfmt+0x375>
				printfmt(putch, putdat, "error %d", err);
  801441:	50                   	push   %eax
  801442:	68 df 20 80 00       	push   $0x8020df
  801447:	53                   	push   %ebx
  801448:	56                   	push   %esi
  801449:	e8 92 fe ff ff       	call   8012e0 <printfmt>
  80144e:	83 c4 10             	add    $0x10,%esp
			err = va_arg(ap, int);
  801451:	89 7d 14             	mov    %edi,0x14(%ebp)
				printfmt(putch, putdat, "error %d", err);
  801454:	e9 1d 02 00 00       	jmp    801676 <vprintfmt+0x375>
			if ((p = va_arg(ap, char *)) == NULL)
  801459:	8b 45 14             	mov    0x14(%ebp),%eax
  80145c:	83 c0 04             	add    $0x4,%eax
  80145f:	89 45 c8             	mov    %eax,-0x38(%ebp)
  801462:	8b 45 14             	mov    0x14(%ebp),%eax
  801465:	8b 10                	mov    (%eax),%edx
				p = "(null)";
  801467:	85 d2                	test   %edx,%edx
  801469:	b8 d8 20 80 00       	mov    $0x8020d8,%eax
  80146e:	0f 45 c2             	cmovne %edx,%eax
  801471:	89 45 cc             	mov    %eax,-0x34(%ebp)
			if (width > 0 && padc != '-')
  801474:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  801478:	7e 06                	jle    801480 <vprintfmt+0x17f>
  80147a:	80 7d d3 2d          	cmpb   $0x2d,-0x2d(%ebp)
  80147e:	75 0d                	jne    80148d <vprintfmt+0x18c>
				for (width -= strnlen(p, precision); width > 0; width--)
  801480:	8b 45 cc             	mov    -0x34(%ebp),%eax
  801483:	89 c7                	mov    %eax,%edi
  801485:	03 45 d4             	add    -0x2c(%ebp),%eax
  801488:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  80148b:	eb 55                	jmp    8014e2 <vprintfmt+0x1e1>
  80148d:	83 ec 08             	sub    $0x8,%esp
  801490:	ff 75 d8             	pushl  -0x28(%ebp)
  801493:	ff 75 cc             	pushl  -0x34(%ebp)
  801496:	e8 15 03 00 00       	call   8017b0 <strnlen>
  80149b:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  80149e:	29 c2                	sub    %eax,%edx
  8014a0:	89 55 c4             	mov    %edx,-0x3c(%ebp)
  8014a3:	83 c4 10             	add    $0x10,%esp
  8014a6:	89 d7                	mov    %edx,%edi
					putch(padc, putdat);
  8014a8:	0f be 45 d3          	movsbl -0x2d(%ebp),%eax
  8014ac:	89 45 d4             	mov    %eax,-0x2c(%ebp)
				for (width -= strnlen(p, precision); width > 0; width--)
  8014af:	85 ff                	test   %edi,%edi
  8014b1:	7e 11                	jle    8014c4 <vprintfmt+0x1c3>
					putch(padc, putdat);
  8014b3:	83 ec 08             	sub    $0x8,%esp
  8014b6:	53                   	push   %ebx
  8014b7:	ff 75 d4             	pushl  -0x2c(%ebp)
  8014ba:	ff d6                	call   *%esi
				for (width -= strnlen(p, precision); width > 0; width--)
  8014bc:	83 ef 01             	sub    $0x1,%edi
  8014bf:	83 c4 10             	add    $0x10,%esp
  8014c2:	eb eb                	jmp    8014af <vprintfmt+0x1ae>
  8014c4:	8b 55 c4             	mov    -0x3c(%ebp),%edx
  8014c7:	85 d2                	test   %edx,%edx
  8014c9:	b8 00 00 00 00       	mov    $0x0,%eax
  8014ce:	0f 49 c2             	cmovns %edx,%eax
  8014d1:	29 c2                	sub    %eax,%edx
  8014d3:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  8014d6:	eb a8                	jmp    801480 <vprintfmt+0x17f>
					putch(ch, putdat);
  8014d8:	83 ec 08             	sub    $0x8,%esp
  8014db:	53                   	push   %ebx
  8014dc:	52                   	push   %edx
  8014dd:	ff d6                	call   *%esi
  8014df:	83 c4 10             	add    $0x10,%esp
  8014e2:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
  8014e5:	29 f9                	sub    %edi,%ecx
			for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--)
  8014e7:	83 c7 01             	add    $0x1,%edi
  8014ea:	0f b6 47 ff          	movzbl -0x1(%edi),%eax
  8014ee:	0f be d0             	movsbl %al,%edx
  8014f1:	85 d2                	test   %edx,%edx
  8014f3:	74 4b                	je     801540 <vprintfmt+0x23f>
  8014f5:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
  8014f9:	78 06                	js     801501 <vprintfmt+0x200>
  8014fb:	83 6d d8 01          	subl   $0x1,-0x28(%ebp)
  8014ff:	78 1e                	js     80151f <vprintfmt+0x21e>
				if (altflag && (ch < ' ' || ch > '~'))
  801501:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
  801505:	74 d1                	je     8014d8 <vprintfmt+0x1d7>
  801507:	0f be c0             	movsbl %al,%eax
  80150a:	83 e8 20             	sub    $0x20,%eax
  80150d:	83 f8 5e             	cmp    $0x5e,%eax
  801510:	76 c6                	jbe    8014d8 <vprintfmt+0x1d7>
					putch('?', putdat);
  801512:	83 ec 08             	sub    $0x8,%esp
  801515:	53                   	push   %ebx
  801516:	6a 3f                	push   $0x3f
  801518:	ff d6                	call   *%esi
  80151a:	83 c4 10             	add    $0x10,%esp
  80151d:	eb c3                	jmp    8014e2 <vprintfmt+0x1e1>
  80151f:	89 cf                	mov    %ecx,%edi
  801521:	eb 0e                	jmp    801531 <vprintfmt+0x230>
				putch(' ', putdat);
  801523:	83 ec 08             	sub    $0x8,%esp
  801526:	53                   	push   %ebx
  801527:	6a 20                	push   $0x20
  801529:	ff d6                	call   *%esi
			for (; width > 0; width--)
  80152b:	83 ef 01             	sub    $0x1,%edi
  80152e:	83 c4 10             	add    $0x10,%esp
  801531:	85 ff                	test   %edi,%edi
  801533:	7f ee                	jg     801523 <vprintfmt+0x222>
			if ((p = va_arg(ap, char *)) == NULL)
  801535:	8b 45 c8             	mov    -0x38(%ebp),%eax
  801538:	89 45 14             	mov    %eax,0x14(%ebp)
  80153b:	e9 36 01 00 00       	jmp    801676 <vprintfmt+0x375>
  801540:	89 cf                	mov    %ecx,%edi
  801542:	eb ed                	jmp    801531 <vprintfmt+0x230>
	if (lflag >= 2)
  801544:	83 f9 01             	cmp    $0x1,%ecx
  801547:	7f 1f                	jg     801568 <vprintfmt+0x267>
	else if (lflag)
  801549:	85 c9                	test   %ecx,%ecx
  80154b:	74 67                	je     8015b4 <vprintfmt+0x2b3>
		return va_arg(*ap, long);
  80154d:	8b 45 14             	mov    0x14(%ebp),%eax
  801550:	8b 00                	mov    (%eax),%eax
  801552:	89 45 d8             	mov    %eax,-0x28(%ebp)
  801555:	89 c1                	mov    %eax,%ecx
  801557:	c1 f9 1f             	sar    $0x1f,%ecx
  80155a:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  80155d:	8b 45 14             	mov    0x14(%ebp),%eax
  801560:	8d 40 04             	lea    0x4(%eax),%eax
  801563:	89 45 14             	mov    %eax,0x14(%ebp)
  801566:	eb 17                	jmp    80157f <vprintfmt+0x27e>
		return va_arg(*ap, long long);
  801568:	8b 45 14             	mov    0x14(%ebp),%eax
  80156b:	8b 50 04             	mov    0x4(%eax),%edx
  80156e:	8b 00                	mov    (%eax),%eax
  801570:	89 45 d8             	mov    %eax,-0x28(%ebp)
  801573:	89 55 dc             	mov    %edx,-0x24(%ebp)
  801576:	8b 45 14             	mov    0x14(%ebp),%eax
  801579:	8d 40 08             	lea    0x8(%eax),%eax
  80157c:	89 45 14             	mov    %eax,0x14(%ebp)
			if ((long long) num < 0) {
  80157f:	8b 55 d8             	mov    -0x28(%ebp),%edx
  801582:	8b 4d dc             	mov    -0x24(%ebp),%ecx
			base = 10;
  801585:	b8 0a 00 00 00       	mov    $0xa,%eax
			if ((long long) num < 0) {
  80158a:	85 c9                	test   %ecx,%ecx
  80158c:	0f 89 ca 00 00 00    	jns    80165c <vprintfmt+0x35b>
				putch('-', putdat);
  801592:	83 ec 08             	sub    $0x8,%esp
  801595:	53                   	push   %ebx
  801596:	6a 2d                	push   $0x2d
  801598:	ff d6                	call   *%esi
				num = -(long long) num;
  80159a:	8b 55 d8             	mov    -0x28(%ebp),%edx
  80159d:	8b 4d dc             	mov    -0x24(%ebp),%ecx
  8015a0:	f7 da                	neg    %edx
  8015a2:	83 d1 00             	adc    $0x0,%ecx
  8015a5:	f7 d9                	neg    %ecx
  8015a7:	83 c4 10             	add    $0x10,%esp
			base = 10;
  8015aa:	b8 0a 00 00 00       	mov    $0xa,%eax
  8015af:	e9 a8 00 00 00       	jmp    80165c <vprintfmt+0x35b>
		return va_arg(*ap, int);
  8015b4:	8b 45 14             	mov    0x14(%ebp),%eax
  8015b7:	8b 00                	mov    (%eax),%eax
  8015b9:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8015bc:	99                   	cltd   
  8015bd:	89 55 dc             	mov    %edx,-0x24(%ebp)
  8015c0:	8b 45 14             	mov    0x14(%ebp),%eax
  8015c3:	8d 40 04             	lea    0x4(%eax),%eax
  8015c6:	89 45 14             	mov    %eax,0x14(%ebp)
  8015c9:	eb b4                	jmp    80157f <vprintfmt+0x27e>
	if (lflag >= 2)
  8015cb:	83 f9 01             	cmp    $0x1,%ecx
  8015ce:	7f 1b                	jg     8015eb <vprintfmt+0x2ea>
	else if (lflag)
  8015d0:	85 c9                	test   %ecx,%ecx
  8015d2:	74 2c                	je     801600 <vprintfmt+0x2ff>
		return va_arg(*ap, unsigned long);
  8015d4:	8b 45 14             	mov    0x14(%ebp),%eax
  8015d7:	8b 10                	mov    (%eax),%edx
  8015d9:	b9 00 00 00 00       	mov    $0x0,%ecx
  8015de:	8d 40 04             	lea    0x4(%eax),%eax
  8015e1:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  8015e4:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned long);
  8015e9:	eb 71                	jmp    80165c <vprintfmt+0x35b>
		return va_arg(*ap, unsigned long long);
  8015eb:	8b 45 14             	mov    0x14(%ebp),%eax
  8015ee:	8b 10                	mov    (%eax),%edx
  8015f0:	8b 48 04             	mov    0x4(%eax),%ecx
  8015f3:	8d 40 08             	lea    0x8(%eax),%eax
  8015f6:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  8015f9:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned long long);
  8015fe:	eb 5c                	jmp    80165c <vprintfmt+0x35b>
		return va_arg(*ap, unsigned int);
  801600:	8b 45 14             	mov    0x14(%ebp),%eax
  801603:	8b 10                	mov    (%eax),%edx
  801605:	b9 00 00 00 00       	mov    $0x0,%ecx
  80160a:	8d 40 04             	lea    0x4(%eax),%eax
  80160d:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  801610:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned int);
  801615:	eb 45                	jmp    80165c <vprintfmt+0x35b>
			putch('X', putdat);
  801617:	83 ec 08             	sub    $0x8,%esp
  80161a:	53                   	push   %ebx
  80161b:	6a 58                	push   $0x58
  80161d:	ff d6                	call   *%esi
			putch('X', putdat);
  80161f:	83 c4 08             	add    $0x8,%esp
  801622:	53                   	push   %ebx
  801623:	6a 58                	push   $0x58
  801625:	ff d6                	call   *%esi
			putch('X', putdat);
  801627:	83 c4 08             	add    $0x8,%esp
  80162a:	53                   	push   %ebx
  80162b:	6a 58                	push   $0x58
  80162d:	ff d6                	call   *%esi
			break;
  80162f:	83 c4 10             	add    $0x10,%esp
  801632:	eb 42                	jmp    801676 <vprintfmt+0x375>
			putch('0', putdat);
  801634:	83 ec 08             	sub    $0x8,%esp
  801637:	53                   	push   %ebx
  801638:	6a 30                	push   $0x30
  80163a:	ff d6                	call   *%esi
			putch('x', putdat);
  80163c:	83 c4 08             	add    $0x8,%esp
  80163f:	53                   	push   %ebx
  801640:	6a 78                	push   $0x78
  801642:	ff d6                	call   *%esi
			num = (unsigned long long)
  801644:	8b 45 14             	mov    0x14(%ebp),%eax
  801647:	8b 10                	mov    (%eax),%edx
  801649:	b9 00 00 00 00       	mov    $0x0,%ecx
			goto number;
  80164e:	83 c4 10             	add    $0x10,%esp
				(uintptr_t) va_arg(ap, void *);
  801651:	8d 40 04             	lea    0x4(%eax),%eax
  801654:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  801657:	b8 10 00 00 00       	mov    $0x10,%eax
			printnum(putch, putdat, num, base, width, padc);
  80165c:	83 ec 0c             	sub    $0xc,%esp
  80165f:	0f be 7d d3          	movsbl -0x2d(%ebp),%edi
  801663:	57                   	push   %edi
  801664:	ff 75 d4             	pushl  -0x2c(%ebp)
  801667:	50                   	push   %eax
  801668:	51                   	push   %ecx
  801669:	52                   	push   %edx
  80166a:	89 da                	mov    %ebx,%edx
  80166c:	89 f0                	mov    %esi,%eax
  80166e:	e8 a3 fb ff ff       	call   801216 <printnum>
			break;
  801673:	83 c4 20             	add    $0x20,%esp
			if ((p = va_arg(ap, char *)) == NULL)
  801676:	8b 7d e4             	mov    -0x1c(%ebp),%edi
		while ((ch = *(unsigned char *) fmt++) != '%') {
  801679:	83 c7 01             	add    $0x1,%edi
  80167c:	0f b6 47 ff          	movzbl -0x1(%edi),%eax
  801680:	83 f8 25             	cmp    $0x25,%eax
  801683:	0f 84 93 fc ff ff    	je     80131c <vprintfmt+0x1b>
			if (ch == '\0')
  801689:	85 c0                	test   %eax,%eax
  80168b:	0f 84 8b 00 00 00    	je     80171c <vprintfmt+0x41b>
			putch(ch, putdat);
  801691:	83 ec 08             	sub    $0x8,%esp
  801694:	53                   	push   %ebx
  801695:	50                   	push   %eax
  801696:	ff d6                	call   *%esi
  801698:	83 c4 10             	add    $0x10,%esp
  80169b:	eb dc                	jmp    801679 <vprintfmt+0x378>
	if (lflag >= 2)
  80169d:	83 f9 01             	cmp    $0x1,%ecx
  8016a0:	7f 1b                	jg     8016bd <vprintfmt+0x3bc>
	else if (lflag)
  8016a2:	85 c9                	test   %ecx,%ecx
  8016a4:	74 2c                	je     8016d2 <vprintfmt+0x3d1>
		return va_arg(*ap, unsigned long);
  8016a6:	8b 45 14             	mov    0x14(%ebp),%eax
  8016a9:	8b 10                	mov    (%eax),%edx
  8016ab:	b9 00 00 00 00       	mov    $0x0,%ecx
  8016b0:	8d 40 04             	lea    0x4(%eax),%eax
  8016b3:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  8016b6:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned long);
  8016bb:	eb 9f                	jmp    80165c <vprintfmt+0x35b>
		return va_arg(*ap, unsigned long long);
  8016bd:	8b 45 14             	mov    0x14(%ebp),%eax
  8016c0:	8b 10                	mov    (%eax),%edx
  8016c2:	8b 48 04             	mov    0x4(%eax),%ecx
  8016c5:	8d 40 08             	lea    0x8(%eax),%eax
  8016c8:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  8016cb:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned long long);
  8016d0:	eb 8a                	jmp    80165c <vprintfmt+0x35b>
		return va_arg(*ap, unsigned int);
  8016d2:	8b 45 14             	mov    0x14(%ebp),%eax
  8016d5:	8b 10                	mov    (%eax),%edx
  8016d7:	b9 00 00 00 00       	mov    $0x0,%ecx
  8016dc:	8d 40 04             	lea    0x4(%eax),%eax
  8016df:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  8016e2:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned int);
  8016e7:	e9 70 ff ff ff       	jmp    80165c <vprintfmt+0x35b>
			putch(ch, putdat);
  8016ec:	83 ec 08             	sub    $0x8,%esp
  8016ef:	53                   	push   %ebx
  8016f0:	6a 25                	push   $0x25
  8016f2:	ff d6                	call   *%esi
			break;
  8016f4:	83 c4 10             	add    $0x10,%esp
  8016f7:	e9 7a ff ff ff       	jmp    801676 <vprintfmt+0x375>
			putch('%', putdat);
  8016fc:	83 ec 08             	sub    $0x8,%esp
  8016ff:	53                   	push   %ebx
  801700:	6a 25                	push   $0x25
  801702:	ff d6                	call   *%esi
			for (fmt--; fmt[-1] != '%'; fmt--)
  801704:	83 c4 10             	add    $0x10,%esp
  801707:	89 f8                	mov    %edi,%eax
  801709:	80 78 ff 25          	cmpb   $0x25,-0x1(%eax)
  80170d:	74 05                	je     801714 <vprintfmt+0x413>
  80170f:	83 e8 01             	sub    $0x1,%eax
  801712:	eb f5                	jmp    801709 <vprintfmt+0x408>
  801714:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  801717:	e9 5a ff ff ff       	jmp    801676 <vprintfmt+0x375>
}
  80171c:	8d 65 f4             	lea    -0xc(%ebp),%esp
  80171f:	5b                   	pop    %ebx
  801720:	5e                   	pop    %esi
  801721:	5f                   	pop    %edi
  801722:	5d                   	pop    %ebp
  801723:	c3                   	ret    

00801724 <vsnprintf>:

int
vsnprintf(char *buf, int n, const char *fmt, va_list ap)
{
  801724:	f3 0f 1e fb          	endbr32 
  801728:	55                   	push   %ebp
  801729:	89 e5                	mov    %esp,%ebp
  80172b:	83 ec 18             	sub    $0x18,%esp
  80172e:	8b 45 08             	mov    0x8(%ebp),%eax
  801731:	8b 55 0c             	mov    0xc(%ebp),%edx
	struct sprintbuf b = {buf, buf+n-1, 0};
  801734:	89 45 ec             	mov    %eax,-0x14(%ebp)
  801737:	8d 4c 10 ff          	lea    -0x1(%eax,%edx,1),%ecx
  80173b:	89 4d f0             	mov    %ecx,-0x10(%ebp)
  80173e:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)

	if (buf == NULL || n < 1)
  801745:	85 c0                	test   %eax,%eax
  801747:	74 26                	je     80176f <vsnprintf+0x4b>
  801749:	85 d2                	test   %edx,%edx
  80174b:	7e 22                	jle    80176f <vsnprintf+0x4b>
		return -E_INVAL;

	// print the string to the buffer
	vprintfmt((void*)sprintputch, &b, fmt, ap);
  80174d:	ff 75 14             	pushl  0x14(%ebp)
  801750:	ff 75 10             	pushl  0x10(%ebp)
  801753:	8d 45 ec             	lea    -0x14(%ebp),%eax
  801756:	50                   	push   %eax
  801757:	68 bf 12 80 00       	push   $0x8012bf
  80175c:	e8 a0 fb ff ff       	call   801301 <vprintfmt>

	// null terminate the buffer
	*b.buf = '\0';
  801761:	8b 45 ec             	mov    -0x14(%ebp),%eax
  801764:	c6 00 00             	movb   $0x0,(%eax)

	return b.cnt;
  801767:	8b 45 f4             	mov    -0xc(%ebp),%eax
  80176a:	83 c4 10             	add    $0x10,%esp
}
  80176d:	c9                   	leave  
  80176e:	c3                   	ret    
		return -E_INVAL;
  80176f:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  801774:	eb f7                	jmp    80176d <vsnprintf+0x49>

00801776 <snprintf>:

int
snprintf(char *buf, int n, const char *fmt, ...)
{
  801776:	f3 0f 1e fb          	endbr32 
  80177a:	55                   	push   %ebp
  80177b:	89 e5                	mov    %esp,%ebp
  80177d:	83 ec 08             	sub    $0x8,%esp
	va_list ap;
	int rc;

	va_start(ap, fmt);
  801780:	8d 45 14             	lea    0x14(%ebp),%eax
	rc = vsnprintf(buf, n, fmt, ap);
  801783:	50                   	push   %eax
  801784:	ff 75 10             	pushl  0x10(%ebp)
  801787:	ff 75 0c             	pushl  0xc(%ebp)
  80178a:	ff 75 08             	pushl  0x8(%ebp)
  80178d:	e8 92 ff ff ff       	call   801724 <vsnprintf>
	va_end(ap);

	return rc;
}
  801792:	c9                   	leave  
  801793:	c3                   	ret    

00801794 <strlen>:
// Primespipe runs 3x faster this way.
#define ASM 1

int
strlen(const char *s)
{
  801794:	f3 0f 1e fb          	endbr32 
  801798:	55                   	push   %ebp
  801799:	89 e5                	mov    %esp,%ebp
  80179b:	8b 55 08             	mov    0x8(%ebp),%edx
	int n;

	for (n = 0; *s != '\0'; s++)
  80179e:	b8 00 00 00 00       	mov    $0x0,%eax
  8017a3:	80 3c 02 00          	cmpb   $0x0,(%edx,%eax,1)
  8017a7:	74 05                	je     8017ae <strlen+0x1a>
		n++;
  8017a9:	83 c0 01             	add    $0x1,%eax
  8017ac:	eb f5                	jmp    8017a3 <strlen+0xf>
	return n;
}
  8017ae:	5d                   	pop    %ebp
  8017af:	c3                   	ret    

008017b0 <strnlen>:

int
strnlen(const char *s, size_t size)
{
  8017b0:	f3 0f 1e fb          	endbr32 
  8017b4:	55                   	push   %ebp
  8017b5:	89 e5                	mov    %esp,%ebp
  8017b7:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8017ba:	8b 55 0c             	mov    0xc(%ebp),%edx
	int n;

	for (n = 0; size > 0 && *s != '\0'; s++, size--)
  8017bd:	b8 00 00 00 00       	mov    $0x0,%eax
  8017c2:	39 d0                	cmp    %edx,%eax
  8017c4:	74 0d                	je     8017d3 <strnlen+0x23>
  8017c6:	80 3c 01 00          	cmpb   $0x0,(%ecx,%eax,1)
  8017ca:	74 05                	je     8017d1 <strnlen+0x21>
		n++;
  8017cc:	83 c0 01             	add    $0x1,%eax
  8017cf:	eb f1                	jmp    8017c2 <strnlen+0x12>
  8017d1:	89 c2                	mov    %eax,%edx
	return n;
}
  8017d3:	89 d0                	mov    %edx,%eax
  8017d5:	5d                   	pop    %ebp
  8017d6:	c3                   	ret    

008017d7 <strcpy>:

char *
strcpy(char *dst, const char *src)
{
  8017d7:	f3 0f 1e fb          	endbr32 
  8017db:	55                   	push   %ebp
  8017dc:	89 e5                	mov    %esp,%ebp
  8017de:	53                   	push   %ebx
  8017df:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8017e2:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	char *ret;

	ret = dst;
	while ((*dst++ = *src++) != '\0')
  8017e5:	b8 00 00 00 00       	mov    $0x0,%eax
  8017ea:	0f b6 14 03          	movzbl (%ebx,%eax,1),%edx
  8017ee:	88 14 01             	mov    %dl,(%ecx,%eax,1)
  8017f1:	83 c0 01             	add    $0x1,%eax
  8017f4:	84 d2                	test   %dl,%dl
  8017f6:	75 f2                	jne    8017ea <strcpy+0x13>
		/* do nothing */;
	return ret;
}
  8017f8:	89 c8                	mov    %ecx,%eax
  8017fa:	5b                   	pop    %ebx
  8017fb:	5d                   	pop    %ebp
  8017fc:	c3                   	ret    

008017fd <strcat>:

char *
strcat(char *dst, const char *src)
{
  8017fd:	f3 0f 1e fb          	endbr32 
  801801:	55                   	push   %ebp
  801802:	89 e5                	mov    %esp,%ebp
  801804:	53                   	push   %ebx
  801805:	83 ec 10             	sub    $0x10,%esp
  801808:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int len = strlen(dst);
  80180b:	53                   	push   %ebx
  80180c:	e8 83 ff ff ff       	call   801794 <strlen>
  801811:	83 c4 08             	add    $0x8,%esp
	strcpy(dst + len, src);
  801814:	ff 75 0c             	pushl  0xc(%ebp)
  801817:	01 d8                	add    %ebx,%eax
  801819:	50                   	push   %eax
  80181a:	e8 b8 ff ff ff       	call   8017d7 <strcpy>
	return dst;
}
  80181f:	89 d8                	mov    %ebx,%eax
  801821:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801824:	c9                   	leave  
  801825:	c3                   	ret    

00801826 <strncpy>:

char *
strncpy(char *dst, const char *src, size_t size) {
  801826:	f3 0f 1e fb          	endbr32 
  80182a:	55                   	push   %ebp
  80182b:	89 e5                	mov    %esp,%ebp
  80182d:	56                   	push   %esi
  80182e:	53                   	push   %ebx
  80182f:	8b 75 08             	mov    0x8(%ebp),%esi
  801832:	8b 55 0c             	mov    0xc(%ebp),%edx
  801835:	89 f3                	mov    %esi,%ebx
  801837:	03 5d 10             	add    0x10(%ebp),%ebx
	size_t i;
	char *ret;

	ret = dst;
	for (i = 0; i < size; i++) {
  80183a:	89 f0                	mov    %esi,%eax
  80183c:	39 d8                	cmp    %ebx,%eax
  80183e:	74 11                	je     801851 <strncpy+0x2b>
		*dst++ = *src;
  801840:	83 c0 01             	add    $0x1,%eax
  801843:	0f b6 0a             	movzbl (%edx),%ecx
  801846:	88 48 ff             	mov    %cl,-0x1(%eax)
		// If strlen(src) < size, null-pad 'dst' out to 'size' chars
		if (*src != '\0')
			src++;
  801849:	80 f9 01             	cmp    $0x1,%cl
  80184c:	83 da ff             	sbb    $0xffffffff,%edx
  80184f:	eb eb                	jmp    80183c <strncpy+0x16>
	}
	return ret;
}
  801851:	89 f0                	mov    %esi,%eax
  801853:	5b                   	pop    %ebx
  801854:	5e                   	pop    %esi
  801855:	5d                   	pop    %ebp
  801856:	c3                   	ret    

00801857 <strlcpy>:

size_t
strlcpy(char *dst, const char *src, size_t size)
{
  801857:	f3 0f 1e fb          	endbr32 
  80185b:	55                   	push   %ebp
  80185c:	89 e5                	mov    %esp,%ebp
  80185e:	56                   	push   %esi
  80185f:	53                   	push   %ebx
  801860:	8b 75 08             	mov    0x8(%ebp),%esi
  801863:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  801866:	8b 55 10             	mov    0x10(%ebp),%edx
  801869:	89 f0                	mov    %esi,%eax
	char *dst_in;

	dst_in = dst;
	if (size > 0) {
  80186b:	85 d2                	test   %edx,%edx
  80186d:	74 21                	je     801890 <strlcpy+0x39>
  80186f:	8d 44 16 ff          	lea    -0x1(%esi,%edx,1),%eax
  801873:	89 f2                	mov    %esi,%edx
		while (--size > 0 && *src != '\0')
  801875:	39 c2                	cmp    %eax,%edx
  801877:	74 14                	je     80188d <strlcpy+0x36>
  801879:	0f b6 19             	movzbl (%ecx),%ebx
  80187c:	84 db                	test   %bl,%bl
  80187e:	74 0b                	je     80188b <strlcpy+0x34>
			*dst++ = *src++;
  801880:	83 c1 01             	add    $0x1,%ecx
  801883:	83 c2 01             	add    $0x1,%edx
  801886:	88 5a ff             	mov    %bl,-0x1(%edx)
  801889:	eb ea                	jmp    801875 <strlcpy+0x1e>
  80188b:	89 d0                	mov    %edx,%eax
		*dst = '\0';
  80188d:	c6 00 00             	movb   $0x0,(%eax)
	}
	return dst - dst_in;
  801890:	29 f0                	sub    %esi,%eax
}
  801892:	5b                   	pop    %ebx
  801893:	5e                   	pop    %esi
  801894:	5d                   	pop    %ebp
  801895:	c3                   	ret    

00801896 <strcmp>:

int
strcmp(const char *p, const char *q)
{
  801896:	f3 0f 1e fb          	endbr32 
  80189a:	55                   	push   %ebp
  80189b:	89 e5                	mov    %esp,%ebp
  80189d:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8018a0:	8b 55 0c             	mov    0xc(%ebp),%edx
	while (*p && *p == *q)
  8018a3:	0f b6 01             	movzbl (%ecx),%eax
  8018a6:	84 c0                	test   %al,%al
  8018a8:	74 0c                	je     8018b6 <strcmp+0x20>
  8018aa:	3a 02                	cmp    (%edx),%al
  8018ac:	75 08                	jne    8018b6 <strcmp+0x20>
		p++, q++;
  8018ae:	83 c1 01             	add    $0x1,%ecx
  8018b1:	83 c2 01             	add    $0x1,%edx
  8018b4:	eb ed                	jmp    8018a3 <strcmp+0xd>
	return (int) ((unsigned char) *p - (unsigned char) *q);
  8018b6:	0f b6 c0             	movzbl %al,%eax
  8018b9:	0f b6 12             	movzbl (%edx),%edx
  8018bc:	29 d0                	sub    %edx,%eax
}
  8018be:	5d                   	pop    %ebp
  8018bf:	c3                   	ret    

008018c0 <strncmp>:

int
strncmp(const char *p, const char *q, size_t n)
{
  8018c0:	f3 0f 1e fb          	endbr32 
  8018c4:	55                   	push   %ebp
  8018c5:	89 e5                	mov    %esp,%ebp
  8018c7:	53                   	push   %ebx
  8018c8:	8b 45 08             	mov    0x8(%ebp),%eax
  8018cb:	8b 55 0c             	mov    0xc(%ebp),%edx
  8018ce:	89 c3                	mov    %eax,%ebx
  8018d0:	03 5d 10             	add    0x10(%ebp),%ebx
	while (n > 0 && *p && *p == *q)
  8018d3:	eb 06                	jmp    8018db <strncmp+0x1b>
		n--, p++, q++;
  8018d5:	83 c0 01             	add    $0x1,%eax
  8018d8:	83 c2 01             	add    $0x1,%edx
	while (n > 0 && *p && *p == *q)
  8018db:	39 d8                	cmp    %ebx,%eax
  8018dd:	74 16                	je     8018f5 <strncmp+0x35>
  8018df:	0f b6 08             	movzbl (%eax),%ecx
  8018e2:	84 c9                	test   %cl,%cl
  8018e4:	74 04                	je     8018ea <strncmp+0x2a>
  8018e6:	3a 0a                	cmp    (%edx),%cl
  8018e8:	74 eb                	je     8018d5 <strncmp+0x15>
	if (n == 0)
		return 0;
	else
		return (int) ((unsigned char) *p - (unsigned char) *q);
  8018ea:	0f b6 00             	movzbl (%eax),%eax
  8018ed:	0f b6 12             	movzbl (%edx),%edx
  8018f0:	29 d0                	sub    %edx,%eax
}
  8018f2:	5b                   	pop    %ebx
  8018f3:	5d                   	pop    %ebp
  8018f4:	c3                   	ret    
		return 0;
  8018f5:	b8 00 00 00 00       	mov    $0x0,%eax
  8018fa:	eb f6                	jmp    8018f2 <strncmp+0x32>

008018fc <strchr>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a null pointer if the string has no 'c'.
char *
strchr(const char *s, char c)
{
  8018fc:	f3 0f 1e fb          	endbr32 
  801900:	55                   	push   %ebp
  801901:	89 e5                	mov    %esp,%ebp
  801903:	8b 45 08             	mov    0x8(%ebp),%eax
  801906:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  80190a:	0f b6 10             	movzbl (%eax),%edx
  80190d:	84 d2                	test   %dl,%dl
  80190f:	74 09                	je     80191a <strchr+0x1e>
		if (*s == c)
  801911:	38 ca                	cmp    %cl,%dl
  801913:	74 0a                	je     80191f <strchr+0x23>
	for (; *s; s++)
  801915:	83 c0 01             	add    $0x1,%eax
  801918:	eb f0                	jmp    80190a <strchr+0xe>
			return (char *) s;
	return 0;
  80191a:	b8 00 00 00 00       	mov    $0x0,%eax
}
  80191f:	5d                   	pop    %ebp
  801920:	c3                   	ret    

00801921 <strfind>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a pointer to the string-ending null character if the string has no 'c'.
char *
strfind(const char *s, char c)
{
  801921:	f3 0f 1e fb          	endbr32 
  801925:	55                   	push   %ebp
  801926:	89 e5                	mov    %esp,%ebp
  801928:	8b 45 08             	mov    0x8(%ebp),%eax
  80192b:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  80192f:	0f b6 10             	movzbl (%eax),%edx
		if (*s == c)
  801932:	38 ca                	cmp    %cl,%dl
  801934:	74 09                	je     80193f <strfind+0x1e>
  801936:	84 d2                	test   %dl,%dl
  801938:	74 05                	je     80193f <strfind+0x1e>
	for (; *s; s++)
  80193a:	83 c0 01             	add    $0x1,%eax
  80193d:	eb f0                	jmp    80192f <strfind+0xe>
			break;
	return (char *) s;
}
  80193f:	5d                   	pop    %ebp
  801940:	c3                   	ret    

00801941 <memset>:

#if ASM
void *
memset(void *v, int c, size_t n)
{
  801941:	f3 0f 1e fb          	endbr32 
  801945:	55                   	push   %ebp
  801946:	89 e5                	mov    %esp,%ebp
  801948:	57                   	push   %edi
  801949:	56                   	push   %esi
  80194a:	53                   	push   %ebx
  80194b:	8b 7d 08             	mov    0x8(%ebp),%edi
  80194e:	8b 4d 10             	mov    0x10(%ebp),%ecx
	char *p;

	if (n == 0)
  801951:	85 c9                	test   %ecx,%ecx
  801953:	74 31                	je     801986 <memset+0x45>
		return v;
	if ((int)v%4 == 0 && n%4 == 0) {
  801955:	89 f8                	mov    %edi,%eax
  801957:	09 c8                	or     %ecx,%eax
  801959:	a8 03                	test   $0x3,%al
  80195b:	75 23                	jne    801980 <memset+0x3f>
		c &= 0xFF;
  80195d:	0f b6 55 0c          	movzbl 0xc(%ebp),%edx
		c = (c<<24)|(c<<16)|(c<<8)|c;
  801961:	89 d3                	mov    %edx,%ebx
  801963:	c1 e3 08             	shl    $0x8,%ebx
  801966:	89 d0                	mov    %edx,%eax
  801968:	c1 e0 18             	shl    $0x18,%eax
  80196b:	89 d6                	mov    %edx,%esi
  80196d:	c1 e6 10             	shl    $0x10,%esi
  801970:	09 f0                	or     %esi,%eax
  801972:	09 c2                	or     %eax,%edx
  801974:	09 da                	or     %ebx,%edx
		asm volatile("cld; rep stosl\n"
			:: "D" (v), "a" (c), "c" (n/4)
  801976:	c1 e9 02             	shr    $0x2,%ecx
		asm volatile("cld; rep stosl\n"
  801979:	89 d0                	mov    %edx,%eax
  80197b:	fc                   	cld    
  80197c:	f3 ab                	rep stos %eax,%es:(%edi)
  80197e:	eb 06                	jmp    801986 <memset+0x45>
			: "cc", "memory");
	} else
		asm volatile("cld; rep stosb\n"
  801980:	8b 45 0c             	mov    0xc(%ebp),%eax
  801983:	fc                   	cld    
  801984:	f3 aa                	rep stos %al,%es:(%edi)
			:: "D" (v), "a" (c), "c" (n)
			: "cc", "memory");
	return v;
}
  801986:	89 f8                	mov    %edi,%eax
  801988:	5b                   	pop    %ebx
  801989:	5e                   	pop    %esi
  80198a:	5f                   	pop    %edi
  80198b:	5d                   	pop    %ebp
  80198c:	c3                   	ret    

0080198d <memmove>:

void *
memmove(void *dst, const void *src, size_t n)
{
  80198d:	f3 0f 1e fb          	endbr32 
  801991:	55                   	push   %ebp
  801992:	89 e5                	mov    %esp,%ebp
  801994:	57                   	push   %edi
  801995:	56                   	push   %esi
  801996:	8b 45 08             	mov    0x8(%ebp),%eax
  801999:	8b 75 0c             	mov    0xc(%ebp),%esi
  80199c:	8b 4d 10             	mov    0x10(%ebp),%ecx
	const char *s;
	char *d;

	s = src;
	d = dst;
	if (s < d && s + n > d) {
  80199f:	39 c6                	cmp    %eax,%esi
  8019a1:	73 32                	jae    8019d5 <memmove+0x48>
  8019a3:	8d 14 0e             	lea    (%esi,%ecx,1),%edx
  8019a6:	39 c2                	cmp    %eax,%edx
  8019a8:	76 2b                	jbe    8019d5 <memmove+0x48>
		s += n;
		d += n;
  8019aa:	8d 3c 08             	lea    (%eax,%ecx,1),%edi
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  8019ad:	89 fe                	mov    %edi,%esi
  8019af:	09 ce                	or     %ecx,%esi
  8019b1:	09 d6                	or     %edx,%esi
  8019b3:	f7 c6 03 00 00 00    	test   $0x3,%esi
  8019b9:	75 0e                	jne    8019c9 <memmove+0x3c>
			asm volatile("std; rep movsl\n"
				:: "D" (d-4), "S" (s-4), "c" (n/4) : "cc", "memory");
  8019bb:	83 ef 04             	sub    $0x4,%edi
  8019be:	8d 72 fc             	lea    -0x4(%edx),%esi
  8019c1:	c1 e9 02             	shr    $0x2,%ecx
			asm volatile("std; rep movsl\n"
  8019c4:	fd                   	std    
  8019c5:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  8019c7:	eb 09                	jmp    8019d2 <memmove+0x45>
		else
			asm volatile("std; rep movsb\n"
				:: "D" (d-1), "S" (s-1), "c" (n) : "cc", "memory");
  8019c9:	83 ef 01             	sub    $0x1,%edi
  8019cc:	8d 72 ff             	lea    -0x1(%edx),%esi
			asm volatile("std; rep movsb\n"
  8019cf:	fd                   	std    
  8019d0:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
		// Some versions of GCC rely on DF being clear
		asm volatile("cld" ::: "cc");
  8019d2:	fc                   	cld    
  8019d3:	eb 1a                	jmp    8019ef <memmove+0x62>
	} else {
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  8019d5:	89 c2                	mov    %eax,%edx
  8019d7:	09 ca                	or     %ecx,%edx
  8019d9:	09 f2                	or     %esi,%edx
  8019db:	f6 c2 03             	test   $0x3,%dl
  8019de:	75 0a                	jne    8019ea <memmove+0x5d>
			asm volatile("cld; rep movsl\n"
				:: "D" (d), "S" (s), "c" (n/4) : "cc", "memory");
  8019e0:	c1 e9 02             	shr    $0x2,%ecx
			asm volatile("cld; rep movsl\n"
  8019e3:	89 c7                	mov    %eax,%edi
  8019e5:	fc                   	cld    
  8019e6:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  8019e8:	eb 05                	jmp    8019ef <memmove+0x62>
		else
			asm volatile("cld; rep movsb\n"
  8019ea:	89 c7                	mov    %eax,%edi
  8019ec:	fc                   	cld    
  8019ed:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
				:: "D" (d), "S" (s), "c" (n) : "cc", "memory");
	}
	return dst;
}
  8019ef:	5e                   	pop    %esi
  8019f0:	5f                   	pop    %edi
  8019f1:	5d                   	pop    %ebp
  8019f2:	c3                   	ret    

008019f3 <memcpy>:
}
#endif

void *
memcpy(void *dst, const void *src, size_t n)
{
  8019f3:	f3 0f 1e fb          	endbr32 
  8019f7:	55                   	push   %ebp
  8019f8:	89 e5                	mov    %esp,%ebp
  8019fa:	83 ec 0c             	sub    $0xc,%esp
	return memmove(dst, src, n);
  8019fd:	ff 75 10             	pushl  0x10(%ebp)
  801a00:	ff 75 0c             	pushl  0xc(%ebp)
  801a03:	ff 75 08             	pushl  0x8(%ebp)
  801a06:	e8 82 ff ff ff       	call   80198d <memmove>
}
  801a0b:	c9                   	leave  
  801a0c:	c3                   	ret    

00801a0d <memcmp>:

int
memcmp(const void *v1, const void *v2, size_t n)
{
  801a0d:	f3 0f 1e fb          	endbr32 
  801a11:	55                   	push   %ebp
  801a12:	89 e5                	mov    %esp,%ebp
  801a14:	56                   	push   %esi
  801a15:	53                   	push   %ebx
  801a16:	8b 45 08             	mov    0x8(%ebp),%eax
  801a19:	8b 55 0c             	mov    0xc(%ebp),%edx
  801a1c:	89 c6                	mov    %eax,%esi
  801a1e:	03 75 10             	add    0x10(%ebp),%esi
	const uint8_t *s1 = (const uint8_t *) v1;
	const uint8_t *s2 = (const uint8_t *) v2;

	while (n-- > 0) {
  801a21:	39 f0                	cmp    %esi,%eax
  801a23:	74 1c                	je     801a41 <memcmp+0x34>
		if (*s1 != *s2)
  801a25:	0f b6 08             	movzbl (%eax),%ecx
  801a28:	0f b6 1a             	movzbl (%edx),%ebx
  801a2b:	38 d9                	cmp    %bl,%cl
  801a2d:	75 08                	jne    801a37 <memcmp+0x2a>
			return (int) *s1 - (int) *s2;
		s1++, s2++;
  801a2f:	83 c0 01             	add    $0x1,%eax
  801a32:	83 c2 01             	add    $0x1,%edx
  801a35:	eb ea                	jmp    801a21 <memcmp+0x14>
			return (int) *s1 - (int) *s2;
  801a37:	0f b6 c1             	movzbl %cl,%eax
  801a3a:	0f b6 db             	movzbl %bl,%ebx
  801a3d:	29 d8                	sub    %ebx,%eax
  801a3f:	eb 05                	jmp    801a46 <memcmp+0x39>
	}

	return 0;
  801a41:	b8 00 00 00 00       	mov    $0x0,%eax
}
  801a46:	5b                   	pop    %ebx
  801a47:	5e                   	pop    %esi
  801a48:	5d                   	pop    %ebp
  801a49:	c3                   	ret    

00801a4a <memfind>:

void *
memfind(const void *s, int c, size_t n)
{
  801a4a:	f3 0f 1e fb          	endbr32 
  801a4e:	55                   	push   %ebp
  801a4f:	89 e5                	mov    %esp,%ebp
  801a51:	8b 45 08             	mov    0x8(%ebp),%eax
  801a54:	8b 4d 0c             	mov    0xc(%ebp),%ecx
	const void *ends = (const char *) s + n;
  801a57:	89 c2                	mov    %eax,%edx
  801a59:	03 55 10             	add    0x10(%ebp),%edx
	for (; s < ends; s++)
  801a5c:	39 d0                	cmp    %edx,%eax
  801a5e:	73 09                	jae    801a69 <memfind+0x1f>
		if (*(const unsigned char *) s == (unsigned char) c)
  801a60:	38 08                	cmp    %cl,(%eax)
  801a62:	74 05                	je     801a69 <memfind+0x1f>
	for (; s < ends; s++)
  801a64:	83 c0 01             	add    $0x1,%eax
  801a67:	eb f3                	jmp    801a5c <memfind+0x12>
			break;
	return (void *) s;
}
  801a69:	5d                   	pop    %ebp
  801a6a:	c3                   	ret    

00801a6b <strtol>:

long
strtol(const char *s, char **endptr, int base)
{
  801a6b:	f3 0f 1e fb          	endbr32 
  801a6f:	55                   	push   %ebp
  801a70:	89 e5                	mov    %esp,%ebp
  801a72:	57                   	push   %edi
  801a73:	56                   	push   %esi
  801a74:	53                   	push   %ebx
  801a75:	8b 4d 08             	mov    0x8(%ebp),%ecx
  801a78:	8b 5d 10             	mov    0x10(%ebp),%ebx
	int neg = 0;
	long val = 0;

	// gobble initial whitespace
	while (*s == ' ' || *s == '\t')
  801a7b:	eb 03                	jmp    801a80 <strtol+0x15>
		s++;
  801a7d:	83 c1 01             	add    $0x1,%ecx
	while (*s == ' ' || *s == '\t')
  801a80:	0f b6 01             	movzbl (%ecx),%eax
  801a83:	3c 20                	cmp    $0x20,%al
  801a85:	74 f6                	je     801a7d <strtol+0x12>
  801a87:	3c 09                	cmp    $0x9,%al
  801a89:	74 f2                	je     801a7d <strtol+0x12>

	// plus/minus sign
	if (*s == '+')
  801a8b:	3c 2b                	cmp    $0x2b,%al
  801a8d:	74 2a                	je     801ab9 <strtol+0x4e>
	int neg = 0;
  801a8f:	bf 00 00 00 00       	mov    $0x0,%edi
		s++;
	else if (*s == '-')
  801a94:	3c 2d                	cmp    $0x2d,%al
  801a96:	74 2b                	je     801ac3 <strtol+0x58>
		s++, neg = 1;

	// hex or octal base prefix
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  801a98:	f7 c3 ef ff ff ff    	test   $0xffffffef,%ebx
  801a9e:	75 0f                	jne    801aaf <strtol+0x44>
  801aa0:	80 39 30             	cmpb   $0x30,(%ecx)
  801aa3:	74 28                	je     801acd <strtol+0x62>
		s += 2, base = 16;
	else if (base == 0 && s[0] == '0')
		s++, base = 8;
	else if (base == 0)
		base = 10;
  801aa5:	85 db                	test   %ebx,%ebx
  801aa7:	b8 0a 00 00 00       	mov    $0xa,%eax
  801aac:	0f 44 d8             	cmove  %eax,%ebx
  801aaf:	b8 00 00 00 00       	mov    $0x0,%eax
  801ab4:	89 5d 10             	mov    %ebx,0x10(%ebp)
  801ab7:	eb 46                	jmp    801aff <strtol+0x94>
		s++;
  801ab9:	83 c1 01             	add    $0x1,%ecx
	int neg = 0;
  801abc:	bf 00 00 00 00       	mov    $0x0,%edi
  801ac1:	eb d5                	jmp    801a98 <strtol+0x2d>
		s++, neg = 1;
  801ac3:	83 c1 01             	add    $0x1,%ecx
  801ac6:	bf 01 00 00 00       	mov    $0x1,%edi
  801acb:	eb cb                	jmp    801a98 <strtol+0x2d>
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  801acd:	80 79 01 78          	cmpb   $0x78,0x1(%ecx)
  801ad1:	74 0e                	je     801ae1 <strtol+0x76>
	else if (base == 0 && s[0] == '0')
  801ad3:	85 db                	test   %ebx,%ebx
  801ad5:	75 d8                	jne    801aaf <strtol+0x44>
		s++, base = 8;
  801ad7:	83 c1 01             	add    $0x1,%ecx
  801ada:	bb 08 00 00 00       	mov    $0x8,%ebx
  801adf:	eb ce                	jmp    801aaf <strtol+0x44>
		s += 2, base = 16;
  801ae1:	83 c1 02             	add    $0x2,%ecx
  801ae4:	bb 10 00 00 00       	mov    $0x10,%ebx
  801ae9:	eb c4                	jmp    801aaf <strtol+0x44>
	// digits
	while (1) {
		int dig;

		if (*s >= '0' && *s <= '9')
			dig = *s - '0';
  801aeb:	0f be d2             	movsbl %dl,%edx
  801aee:	83 ea 30             	sub    $0x30,%edx
			dig = *s - 'a' + 10;
		else if (*s >= 'A' && *s <= 'Z')
			dig = *s - 'A' + 10;
		else
			break;
		if (dig >= base)
  801af1:	3b 55 10             	cmp    0x10(%ebp),%edx
  801af4:	7d 3a                	jge    801b30 <strtol+0xc5>
			break;
		s++, val = (val * base) + dig;
  801af6:	83 c1 01             	add    $0x1,%ecx
  801af9:	0f af 45 10          	imul   0x10(%ebp),%eax
  801afd:	01 d0                	add    %edx,%eax
		if (*s >= '0' && *s <= '9')
  801aff:	0f b6 11             	movzbl (%ecx),%edx
  801b02:	8d 72 d0             	lea    -0x30(%edx),%esi
  801b05:	89 f3                	mov    %esi,%ebx
  801b07:	80 fb 09             	cmp    $0x9,%bl
  801b0a:	76 df                	jbe    801aeb <strtol+0x80>
		else if (*s >= 'a' && *s <= 'z')
  801b0c:	8d 72 9f             	lea    -0x61(%edx),%esi
  801b0f:	89 f3                	mov    %esi,%ebx
  801b11:	80 fb 19             	cmp    $0x19,%bl
  801b14:	77 08                	ja     801b1e <strtol+0xb3>
			dig = *s - 'a' + 10;
  801b16:	0f be d2             	movsbl %dl,%edx
  801b19:	83 ea 57             	sub    $0x57,%edx
  801b1c:	eb d3                	jmp    801af1 <strtol+0x86>
		else if (*s >= 'A' && *s <= 'Z')
  801b1e:	8d 72 bf             	lea    -0x41(%edx),%esi
  801b21:	89 f3                	mov    %esi,%ebx
  801b23:	80 fb 19             	cmp    $0x19,%bl
  801b26:	77 08                	ja     801b30 <strtol+0xc5>
			dig = *s - 'A' + 10;
  801b28:	0f be d2             	movsbl %dl,%edx
  801b2b:	83 ea 37             	sub    $0x37,%edx
  801b2e:	eb c1                	jmp    801af1 <strtol+0x86>
		// we don't properly detect overflow!
	}

	if (endptr)
  801b30:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  801b34:	74 05                	je     801b3b <strtol+0xd0>
		*endptr = (char *) s;
  801b36:	8b 75 0c             	mov    0xc(%ebp),%esi
  801b39:	89 0e                	mov    %ecx,(%esi)
	return (neg ? -val : val);
  801b3b:	89 c2                	mov    %eax,%edx
  801b3d:	f7 da                	neg    %edx
  801b3f:	85 ff                	test   %edi,%edi
  801b41:	0f 45 c2             	cmovne %edx,%eax
}
  801b44:	5b                   	pop    %ebx
  801b45:	5e                   	pop    %esi
  801b46:	5f                   	pop    %edi
  801b47:	5d                   	pop    %ebp
  801b48:	c3                   	ret    

00801b49 <set_pgfault_handler>:
// at UXSTACKTOP), and tell the kernel to call the assembly-language
// _pgfault_upcall routine when a page fault occurs.
//
void
set_pgfault_handler(void (*handler)(struct UTrapframe *utf))
{
  801b49:	f3 0f 1e fb          	endbr32 
  801b4d:	55                   	push   %ebp
  801b4e:	89 e5                	mov    %esp,%ebp
  801b50:	83 ec 08             	sub    $0x8,%esp
	int r;

	if (_pgfault_handler == 0) {
  801b53:	83 3d 00 60 80 00 00 	cmpl   $0x0,0x806000
  801b5a:	74 27                	je     801b83 <set_pgfault_handler+0x3a>
		if(sys_page_alloc(0,(void *)UXSTACKTOP-PGSIZE,PTE_W|PTE_U|PTE_P)<0)
			panic("set_pgfault_handler:sys_page_alloc failed");
	}

	// Save handler pointer for assembly to call.
	_pgfault_handler = handler;
  801b5c:	8b 45 08             	mov    0x8(%ebp),%eax
  801b5f:	a3 00 60 80 00       	mov    %eax,0x806000
	if (sys_env_set_pgfault_upcall(thisenv->env_id,_pgfault_upcall)<0)	
  801b64:	a1 04 40 80 00       	mov    0x804004,%eax
  801b69:	8b 40 48             	mov    0x48(%eax),%eax
  801b6c:	83 ec 08             	sub    $0x8,%esp
  801b6f:	68 ab 03 80 00       	push   $0x8003ab
  801b74:	50                   	push   %eax
  801b75:	e8 7f e7 ff ff       	call   8002f9 <sys_env_set_pgfault_upcall>
  801b7a:	83 c4 10             	add    $0x10,%esp
  801b7d:	85 c0                	test   %eax,%eax
  801b7f:	78 2e                	js     801baf <set_pgfault_handler+0x66>
        panic("set_pgfault_handler:sys_env_set_pgfault_upcall failed");
}
  801b81:	c9                   	leave  
  801b82:	c3                   	ret    
		if(sys_page_alloc(0,(void *)UXSTACKTOP-PGSIZE,PTE_W|PTE_U|PTE_P)<0)
  801b83:	83 ec 04             	sub    $0x4,%esp
  801b86:	6a 07                	push   $0x7
  801b88:	68 00 f0 bf ee       	push   $0xeebff000
  801b8d:	6a 00                	push   $0x0
  801b8f:	e8 06 e6 ff ff       	call   80019a <sys_page_alloc>
  801b94:	83 c4 10             	add    $0x10,%esp
  801b97:	85 c0                	test   %eax,%eax
  801b99:	79 c1                	jns    801b5c <set_pgfault_handler+0x13>
			panic("set_pgfault_handler:sys_page_alloc failed");
  801b9b:	83 ec 04             	sub    $0x4,%esp
  801b9e:	68 c0 23 80 00       	push   $0x8023c0
  801ba3:	6a 21                	push   $0x21
  801ba5:	68 22 24 80 00       	push   $0x802422
  801baa:	e8 68 f5 ff ff       	call   801117 <_panic>
        panic("set_pgfault_handler:sys_env_set_pgfault_upcall failed");
  801baf:	83 ec 04             	sub    $0x4,%esp
  801bb2:	68 ec 23 80 00       	push   $0x8023ec
  801bb7:	6a 27                	push   $0x27
  801bb9:	68 22 24 80 00       	push   $0x802422
  801bbe:	e8 54 f5 ff ff       	call   801117 <_panic>

00801bc3 <ipc_recv>:
//   If 'pg' is null, pass sys_ipc_recv a value that it will understand
//   as meaning "no page".  (Zero is not the right value, since that's
//   a perfectly valid place to map a page.)
int32_t
ipc_recv(envid_t *from_env_store, void *pg, int *perm_store)
{
  801bc3:	f3 0f 1e fb          	endbr32 
  801bc7:	55                   	push   %ebp
  801bc8:	89 e5                	mov    %esp,%ebp
  801bca:	56                   	push   %esi
  801bcb:	53                   	push   %ebx
  801bcc:	8b 75 08             	mov    0x8(%ebp),%esi
  801bcf:	8b 45 0c             	mov    0xc(%ebp),%eax
  801bd2:	8b 5d 10             	mov    0x10(%ebp),%ebx
	// LAB 4: Your code here.
	int error;
	if(!pg)pg = (void *)UTOP; // 如果设置为UTOP，这个值其实可以比UTOP大，设置为这个值认为pg无效了，不会进行页面传递【共享页面的设置】，而是只进行值value的传递。
  801bd5:	85 c0                	test   %eax,%eax
  801bd7:	ba 00 00 c0 ee       	mov    $0xeec00000,%edx
  801bdc:	0f 44 c2             	cmove  %edx,%eax
	if((error = sys_ipc_recv(pg)) < 0){
  801bdf:	83 ec 0c             	sub    $0xc,%esp
  801be2:	50                   	push   %eax
  801be3:	e8 7e e7 ff ff       	call   800366 <sys_ipc_recv>
  801be8:	83 c4 10             	add    $0x10,%esp
  801beb:	85 c0                	test   %eax,%eax
  801bed:	78 3f                	js     801c2e <ipc_recv+0x6b>
		if(from_env_store)*from_env_store = 0;
		if(perm_store)*perm_store = 0;
		return error;
	}

	thisenv = &envs[ENVX(sys_getenvid())]; // for lab4's challenge sfork().
  801bef:	e8 60 e5 ff ff       	call   800154 <sys_getenvid>
  801bf4:	25 ff 03 00 00       	and    $0x3ff,%eax
  801bf9:	6b d0 7c             	imul   $0x7c,%eax,%edx
  801bfc:	81 c2 00 00 c0 ee    	add    $0xeec00000,%edx
  801c02:	89 15 04 40 80 00    	mov    %edx,0x804004

	if(from_env_store)*from_env_store = thisenv->env_ipc_from;
  801c08:	85 f6                	test   %esi,%esi
  801c0a:	74 05                	je     801c11 <ipc_recv+0x4e>
  801c0c:	8b 42 74             	mov    0x74(%edx),%eax
  801c0f:	89 06                	mov    %eax,(%esi)
	if(perm_store)*perm_store = thisenv->env_ipc_perm;
  801c11:	85 db                	test   %ebx,%ebx
  801c13:	74 0a                	je     801c1f <ipc_recv+0x5c>
  801c15:	a1 04 40 80 00       	mov    0x804004,%eax
  801c1a:	8b 40 78             	mov    0x78(%eax),%eax
  801c1d:	89 03                	mov    %eax,(%ebx)
	return thisenv->env_ipc_value;
  801c1f:	a1 04 40 80 00       	mov    0x804004,%eax
  801c24:	8b 40 70             	mov    0x70(%eax),%eax
}
  801c27:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801c2a:	5b                   	pop    %ebx
  801c2b:	5e                   	pop    %esi
  801c2c:	5d                   	pop    %ebp
  801c2d:	c3                   	ret    
		if(from_env_store)*from_env_store = 0;
  801c2e:	85 f6                	test   %esi,%esi
  801c30:	74 06                	je     801c38 <ipc_recv+0x75>
  801c32:	c7 06 00 00 00 00    	movl   $0x0,(%esi)
		if(perm_store)*perm_store = 0;
  801c38:	85 db                	test   %ebx,%ebx
  801c3a:	74 eb                	je     801c27 <ipc_recv+0x64>
  801c3c:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  801c42:	eb e3                	jmp    801c27 <ipc_recv+0x64>

00801c44 <ipc_send>:
//   Use sys_yield() to be CPU-friendly.
//   If 'pg' is null, pass sys_ipc_try_send a value that it will understand
//   as meaning "no page".  (Zero is not the right value.)
void
ipc_send(envid_t to_env, uint32_t val, void *pg, int perm)
{
  801c44:	f3 0f 1e fb          	endbr32 
  801c48:	55                   	push   %ebp
  801c49:	89 e5                	mov    %esp,%ebp
  801c4b:	57                   	push   %edi
  801c4c:	56                   	push   %esi
  801c4d:	53                   	push   %ebx
  801c4e:	83 ec 0c             	sub    $0xc,%esp
  801c51:	8b 7d 08             	mov    0x8(%ebp),%edi
  801c54:	8b 75 0c             	mov    0xc(%ebp),%esi
  801c57:	8b 5d 10             	mov    0x10(%ebp),%ebx
	// LAB 4: Your code here.
	if(!pg)pg = (void *)UTOP; // 不会进行页面共享，只会sending message。
  801c5a:	85 db                	test   %ebx,%ebx
  801c5c:	b8 00 00 c0 ee       	mov    $0xeec00000,%eax
  801c61:	0f 44 d8             	cmove  %eax,%ebx
	int error;
	// Keep trying until it succeeds.
	while((error = sys_ipc_try_send(to_env, val, pg, perm)) < 0){
  801c64:	ff 75 14             	pushl  0x14(%ebp)
  801c67:	53                   	push   %ebx
  801c68:	56                   	push   %esi
  801c69:	57                   	push   %edi
  801c6a:	e8 d0 e6 ff ff       	call   80033f <sys_ipc_try_send>
  801c6f:	83 c4 10             	add    $0x10,%esp
  801c72:	85 c0                	test   %eax,%eax
  801c74:	79 1e                	jns    801c94 <ipc_send+0x50>
        //如果error是没有接收者，那么就会继续尝试send
		if(error != -E_IPC_NOT_RECV){
  801c76:	83 f8 f9             	cmp    $0xfffffff9,%eax
  801c79:	75 07                	jne    801c82 <ipc_send+0x3e>
			panic("sys_ipc_try_send:%e", error);
		}
        //但是不是一味的占用cpu，而是尝试一次就释放CPU，等待再次被调度，才会重新send，寻找receiver。
		sys_yield(); // To be CPU-friendly.
  801c7b:	e8 f7 e4 ff ff       	call   800177 <sys_yield>
  801c80:	eb e2                	jmp    801c64 <ipc_send+0x20>
			panic("sys_ipc_try_send:%e", error);
  801c82:	50                   	push   %eax
  801c83:	68 30 24 80 00       	push   $0x802430
  801c88:	6a 3b                	push   $0x3b
  801c8a:	68 44 24 80 00       	push   $0x802444
  801c8f:	e8 83 f4 ff ff       	call   801117 <_panic>
	}
}
  801c94:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801c97:	5b                   	pop    %ebx
  801c98:	5e                   	pop    %esi
  801c99:	5f                   	pop    %edi
  801c9a:	5d                   	pop    %ebp
  801c9b:	c3                   	ret    

00801c9c <ipc_find_env>:
// Find the first environment of the given type.  We'll use this to
// find special environments.
// Returns 0 if no such environment exists.
envid_t
ipc_find_env(enum EnvType type)
{
  801c9c:	f3 0f 1e fb          	endbr32 
  801ca0:	55                   	push   %ebp
  801ca1:	89 e5                	mov    %esp,%ebp
  801ca3:	8b 4d 08             	mov    0x8(%ebp),%ecx
	int i;
	for (i = 0; i < NENV; i++)
  801ca6:	b8 00 00 00 00       	mov    $0x0,%eax
		if (envs[i].env_type == type)
  801cab:	6b d0 7c             	imul   $0x7c,%eax,%edx
  801cae:	81 c2 00 00 c0 ee    	add    $0xeec00000,%edx
  801cb4:	8b 52 50             	mov    0x50(%edx),%edx
  801cb7:	39 ca                	cmp    %ecx,%edx
  801cb9:	74 11                	je     801ccc <ipc_find_env+0x30>
	for (i = 0; i < NENV; i++)
  801cbb:	83 c0 01             	add    $0x1,%eax
  801cbe:	3d 00 04 00 00       	cmp    $0x400,%eax
  801cc3:	75 e6                	jne    801cab <ipc_find_env+0xf>
			return envs[i].env_id;
	return 0;
  801cc5:	b8 00 00 00 00       	mov    $0x0,%eax
  801cca:	eb 0b                	jmp    801cd7 <ipc_find_env+0x3b>
			return envs[i].env_id;
  801ccc:	6b c0 7c             	imul   $0x7c,%eax,%eax
  801ccf:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  801cd4:	8b 40 48             	mov    0x48(%eax),%eax
}
  801cd7:	5d                   	pop    %ebp
  801cd8:	c3                   	ret    

00801cd9 <pageref>:
#include <inc/lib.h>

int
pageref(void *v)
{
  801cd9:	f3 0f 1e fb          	endbr32 
  801cdd:	55                   	push   %ebp
  801cde:	89 e5                	mov    %esp,%ebp
  801ce0:	8b 45 08             	mov    0x8(%ebp),%eax
	pte_t pte;

	if (!(uvpd[PDX(v)] & PTE_P))
  801ce3:	89 c2                	mov    %eax,%edx
  801ce5:	c1 ea 16             	shr    $0x16,%edx
  801ce8:	8b 0c 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%ecx
		return 0;
  801cef:	ba 00 00 00 00       	mov    $0x0,%edx
	if (!(uvpd[PDX(v)] & PTE_P))
  801cf4:	f6 c1 01             	test   $0x1,%cl
  801cf7:	74 1c                	je     801d15 <pageref+0x3c>
	pte = uvpt[PGNUM(v)];
  801cf9:	c1 e8 0c             	shr    $0xc,%eax
  801cfc:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
	if (!(pte & PTE_P))
  801d03:	a8 01                	test   $0x1,%al
  801d05:	74 0e                	je     801d15 <pageref+0x3c>
		return 0;
	return pages[PGNUM(pte)].pp_ref;
  801d07:	c1 e8 0c             	shr    $0xc,%eax
  801d0a:	0f b7 14 c5 04 00 00 	movzwl -0x10fffffc(,%eax,8),%edx
  801d11:	ef 
  801d12:	0f b7 d2             	movzwl %dx,%edx
}
  801d15:	89 d0                	mov    %edx,%eax
  801d17:	5d                   	pop    %ebp
  801d18:	c3                   	ret    
  801d19:	66 90                	xchg   %ax,%ax
  801d1b:	66 90                	xchg   %ax,%ax
  801d1d:	66 90                	xchg   %ax,%ax
  801d1f:	90                   	nop

00801d20 <__udivdi3>:
  801d20:	f3 0f 1e fb          	endbr32 
  801d24:	55                   	push   %ebp
  801d25:	57                   	push   %edi
  801d26:	56                   	push   %esi
  801d27:	53                   	push   %ebx
  801d28:	83 ec 1c             	sub    $0x1c,%esp
  801d2b:	8b 54 24 3c          	mov    0x3c(%esp),%edx
  801d2f:	8b 6c 24 30          	mov    0x30(%esp),%ebp
  801d33:	8b 74 24 34          	mov    0x34(%esp),%esi
  801d37:	8b 5c 24 38          	mov    0x38(%esp),%ebx
  801d3b:	85 d2                	test   %edx,%edx
  801d3d:	75 19                	jne    801d58 <__udivdi3+0x38>
  801d3f:	39 f3                	cmp    %esi,%ebx
  801d41:	76 4d                	jbe    801d90 <__udivdi3+0x70>
  801d43:	31 ff                	xor    %edi,%edi
  801d45:	89 e8                	mov    %ebp,%eax
  801d47:	89 f2                	mov    %esi,%edx
  801d49:	f7 f3                	div    %ebx
  801d4b:	89 fa                	mov    %edi,%edx
  801d4d:	83 c4 1c             	add    $0x1c,%esp
  801d50:	5b                   	pop    %ebx
  801d51:	5e                   	pop    %esi
  801d52:	5f                   	pop    %edi
  801d53:	5d                   	pop    %ebp
  801d54:	c3                   	ret    
  801d55:	8d 76 00             	lea    0x0(%esi),%esi
  801d58:	39 f2                	cmp    %esi,%edx
  801d5a:	76 14                	jbe    801d70 <__udivdi3+0x50>
  801d5c:	31 ff                	xor    %edi,%edi
  801d5e:	31 c0                	xor    %eax,%eax
  801d60:	89 fa                	mov    %edi,%edx
  801d62:	83 c4 1c             	add    $0x1c,%esp
  801d65:	5b                   	pop    %ebx
  801d66:	5e                   	pop    %esi
  801d67:	5f                   	pop    %edi
  801d68:	5d                   	pop    %ebp
  801d69:	c3                   	ret    
  801d6a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  801d70:	0f bd fa             	bsr    %edx,%edi
  801d73:	83 f7 1f             	xor    $0x1f,%edi
  801d76:	75 48                	jne    801dc0 <__udivdi3+0xa0>
  801d78:	39 f2                	cmp    %esi,%edx
  801d7a:	72 06                	jb     801d82 <__udivdi3+0x62>
  801d7c:	31 c0                	xor    %eax,%eax
  801d7e:	39 eb                	cmp    %ebp,%ebx
  801d80:	77 de                	ja     801d60 <__udivdi3+0x40>
  801d82:	b8 01 00 00 00       	mov    $0x1,%eax
  801d87:	eb d7                	jmp    801d60 <__udivdi3+0x40>
  801d89:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801d90:	89 d9                	mov    %ebx,%ecx
  801d92:	85 db                	test   %ebx,%ebx
  801d94:	75 0b                	jne    801da1 <__udivdi3+0x81>
  801d96:	b8 01 00 00 00       	mov    $0x1,%eax
  801d9b:	31 d2                	xor    %edx,%edx
  801d9d:	f7 f3                	div    %ebx
  801d9f:	89 c1                	mov    %eax,%ecx
  801da1:	31 d2                	xor    %edx,%edx
  801da3:	89 f0                	mov    %esi,%eax
  801da5:	f7 f1                	div    %ecx
  801da7:	89 c6                	mov    %eax,%esi
  801da9:	89 e8                	mov    %ebp,%eax
  801dab:	89 f7                	mov    %esi,%edi
  801dad:	f7 f1                	div    %ecx
  801daf:	89 fa                	mov    %edi,%edx
  801db1:	83 c4 1c             	add    $0x1c,%esp
  801db4:	5b                   	pop    %ebx
  801db5:	5e                   	pop    %esi
  801db6:	5f                   	pop    %edi
  801db7:	5d                   	pop    %ebp
  801db8:	c3                   	ret    
  801db9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801dc0:	89 f9                	mov    %edi,%ecx
  801dc2:	b8 20 00 00 00       	mov    $0x20,%eax
  801dc7:	29 f8                	sub    %edi,%eax
  801dc9:	d3 e2                	shl    %cl,%edx
  801dcb:	89 54 24 08          	mov    %edx,0x8(%esp)
  801dcf:	89 c1                	mov    %eax,%ecx
  801dd1:	89 da                	mov    %ebx,%edx
  801dd3:	d3 ea                	shr    %cl,%edx
  801dd5:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  801dd9:	09 d1                	or     %edx,%ecx
  801ddb:	89 f2                	mov    %esi,%edx
  801ddd:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  801de1:	89 f9                	mov    %edi,%ecx
  801de3:	d3 e3                	shl    %cl,%ebx
  801de5:	89 c1                	mov    %eax,%ecx
  801de7:	d3 ea                	shr    %cl,%edx
  801de9:	89 f9                	mov    %edi,%ecx
  801deb:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
  801def:	89 eb                	mov    %ebp,%ebx
  801df1:	d3 e6                	shl    %cl,%esi
  801df3:	89 c1                	mov    %eax,%ecx
  801df5:	d3 eb                	shr    %cl,%ebx
  801df7:	09 de                	or     %ebx,%esi
  801df9:	89 f0                	mov    %esi,%eax
  801dfb:	f7 74 24 08          	divl   0x8(%esp)
  801dff:	89 d6                	mov    %edx,%esi
  801e01:	89 c3                	mov    %eax,%ebx
  801e03:	f7 64 24 0c          	mull   0xc(%esp)
  801e07:	39 d6                	cmp    %edx,%esi
  801e09:	72 15                	jb     801e20 <__udivdi3+0x100>
  801e0b:	89 f9                	mov    %edi,%ecx
  801e0d:	d3 e5                	shl    %cl,%ebp
  801e0f:	39 c5                	cmp    %eax,%ebp
  801e11:	73 04                	jae    801e17 <__udivdi3+0xf7>
  801e13:	39 d6                	cmp    %edx,%esi
  801e15:	74 09                	je     801e20 <__udivdi3+0x100>
  801e17:	89 d8                	mov    %ebx,%eax
  801e19:	31 ff                	xor    %edi,%edi
  801e1b:	e9 40 ff ff ff       	jmp    801d60 <__udivdi3+0x40>
  801e20:	8d 43 ff             	lea    -0x1(%ebx),%eax
  801e23:	31 ff                	xor    %edi,%edi
  801e25:	e9 36 ff ff ff       	jmp    801d60 <__udivdi3+0x40>
  801e2a:	66 90                	xchg   %ax,%ax
  801e2c:	66 90                	xchg   %ax,%ax
  801e2e:	66 90                	xchg   %ax,%ax

00801e30 <__umoddi3>:
  801e30:	f3 0f 1e fb          	endbr32 
  801e34:	55                   	push   %ebp
  801e35:	57                   	push   %edi
  801e36:	56                   	push   %esi
  801e37:	53                   	push   %ebx
  801e38:	83 ec 1c             	sub    $0x1c,%esp
  801e3b:	8b 44 24 3c          	mov    0x3c(%esp),%eax
  801e3f:	8b 74 24 30          	mov    0x30(%esp),%esi
  801e43:	8b 5c 24 34          	mov    0x34(%esp),%ebx
  801e47:	8b 7c 24 38          	mov    0x38(%esp),%edi
  801e4b:	85 c0                	test   %eax,%eax
  801e4d:	75 19                	jne    801e68 <__umoddi3+0x38>
  801e4f:	39 df                	cmp    %ebx,%edi
  801e51:	76 5d                	jbe    801eb0 <__umoddi3+0x80>
  801e53:	89 f0                	mov    %esi,%eax
  801e55:	89 da                	mov    %ebx,%edx
  801e57:	f7 f7                	div    %edi
  801e59:	89 d0                	mov    %edx,%eax
  801e5b:	31 d2                	xor    %edx,%edx
  801e5d:	83 c4 1c             	add    $0x1c,%esp
  801e60:	5b                   	pop    %ebx
  801e61:	5e                   	pop    %esi
  801e62:	5f                   	pop    %edi
  801e63:	5d                   	pop    %ebp
  801e64:	c3                   	ret    
  801e65:	8d 76 00             	lea    0x0(%esi),%esi
  801e68:	89 f2                	mov    %esi,%edx
  801e6a:	39 d8                	cmp    %ebx,%eax
  801e6c:	76 12                	jbe    801e80 <__umoddi3+0x50>
  801e6e:	89 f0                	mov    %esi,%eax
  801e70:	89 da                	mov    %ebx,%edx
  801e72:	83 c4 1c             	add    $0x1c,%esp
  801e75:	5b                   	pop    %ebx
  801e76:	5e                   	pop    %esi
  801e77:	5f                   	pop    %edi
  801e78:	5d                   	pop    %ebp
  801e79:	c3                   	ret    
  801e7a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  801e80:	0f bd e8             	bsr    %eax,%ebp
  801e83:	83 f5 1f             	xor    $0x1f,%ebp
  801e86:	75 50                	jne    801ed8 <__umoddi3+0xa8>
  801e88:	39 d8                	cmp    %ebx,%eax
  801e8a:	0f 82 e0 00 00 00    	jb     801f70 <__umoddi3+0x140>
  801e90:	89 d9                	mov    %ebx,%ecx
  801e92:	39 f7                	cmp    %esi,%edi
  801e94:	0f 86 d6 00 00 00    	jbe    801f70 <__umoddi3+0x140>
  801e9a:	89 d0                	mov    %edx,%eax
  801e9c:	89 ca                	mov    %ecx,%edx
  801e9e:	83 c4 1c             	add    $0x1c,%esp
  801ea1:	5b                   	pop    %ebx
  801ea2:	5e                   	pop    %esi
  801ea3:	5f                   	pop    %edi
  801ea4:	5d                   	pop    %ebp
  801ea5:	c3                   	ret    
  801ea6:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801ead:	8d 76 00             	lea    0x0(%esi),%esi
  801eb0:	89 fd                	mov    %edi,%ebp
  801eb2:	85 ff                	test   %edi,%edi
  801eb4:	75 0b                	jne    801ec1 <__umoddi3+0x91>
  801eb6:	b8 01 00 00 00       	mov    $0x1,%eax
  801ebb:	31 d2                	xor    %edx,%edx
  801ebd:	f7 f7                	div    %edi
  801ebf:	89 c5                	mov    %eax,%ebp
  801ec1:	89 d8                	mov    %ebx,%eax
  801ec3:	31 d2                	xor    %edx,%edx
  801ec5:	f7 f5                	div    %ebp
  801ec7:	89 f0                	mov    %esi,%eax
  801ec9:	f7 f5                	div    %ebp
  801ecb:	89 d0                	mov    %edx,%eax
  801ecd:	31 d2                	xor    %edx,%edx
  801ecf:	eb 8c                	jmp    801e5d <__umoddi3+0x2d>
  801ed1:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801ed8:	89 e9                	mov    %ebp,%ecx
  801eda:	ba 20 00 00 00       	mov    $0x20,%edx
  801edf:	29 ea                	sub    %ebp,%edx
  801ee1:	d3 e0                	shl    %cl,%eax
  801ee3:	89 44 24 08          	mov    %eax,0x8(%esp)
  801ee7:	89 d1                	mov    %edx,%ecx
  801ee9:	89 f8                	mov    %edi,%eax
  801eeb:	d3 e8                	shr    %cl,%eax
  801eed:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  801ef1:	89 54 24 04          	mov    %edx,0x4(%esp)
  801ef5:	8b 54 24 04          	mov    0x4(%esp),%edx
  801ef9:	09 c1                	or     %eax,%ecx
  801efb:	89 d8                	mov    %ebx,%eax
  801efd:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  801f01:	89 e9                	mov    %ebp,%ecx
  801f03:	d3 e7                	shl    %cl,%edi
  801f05:	89 d1                	mov    %edx,%ecx
  801f07:	d3 e8                	shr    %cl,%eax
  801f09:	89 e9                	mov    %ebp,%ecx
  801f0b:	89 7c 24 0c          	mov    %edi,0xc(%esp)
  801f0f:	d3 e3                	shl    %cl,%ebx
  801f11:	89 c7                	mov    %eax,%edi
  801f13:	89 d1                	mov    %edx,%ecx
  801f15:	89 f0                	mov    %esi,%eax
  801f17:	d3 e8                	shr    %cl,%eax
  801f19:	89 e9                	mov    %ebp,%ecx
  801f1b:	89 fa                	mov    %edi,%edx
  801f1d:	d3 e6                	shl    %cl,%esi
  801f1f:	09 d8                	or     %ebx,%eax
  801f21:	f7 74 24 08          	divl   0x8(%esp)
  801f25:	89 d1                	mov    %edx,%ecx
  801f27:	89 f3                	mov    %esi,%ebx
  801f29:	f7 64 24 0c          	mull   0xc(%esp)
  801f2d:	89 c6                	mov    %eax,%esi
  801f2f:	89 d7                	mov    %edx,%edi
  801f31:	39 d1                	cmp    %edx,%ecx
  801f33:	72 06                	jb     801f3b <__umoddi3+0x10b>
  801f35:	75 10                	jne    801f47 <__umoddi3+0x117>
  801f37:	39 c3                	cmp    %eax,%ebx
  801f39:	73 0c                	jae    801f47 <__umoddi3+0x117>
  801f3b:	2b 44 24 0c          	sub    0xc(%esp),%eax
  801f3f:	1b 54 24 08          	sbb    0x8(%esp),%edx
  801f43:	89 d7                	mov    %edx,%edi
  801f45:	89 c6                	mov    %eax,%esi
  801f47:	89 ca                	mov    %ecx,%edx
  801f49:	0f b6 4c 24 04       	movzbl 0x4(%esp),%ecx
  801f4e:	29 f3                	sub    %esi,%ebx
  801f50:	19 fa                	sbb    %edi,%edx
  801f52:	89 d0                	mov    %edx,%eax
  801f54:	d3 e0                	shl    %cl,%eax
  801f56:	89 e9                	mov    %ebp,%ecx
  801f58:	d3 eb                	shr    %cl,%ebx
  801f5a:	d3 ea                	shr    %cl,%edx
  801f5c:	09 d8                	or     %ebx,%eax
  801f5e:	83 c4 1c             	add    $0x1c,%esp
  801f61:	5b                   	pop    %ebx
  801f62:	5e                   	pop    %esi
  801f63:	5f                   	pop    %edi
  801f64:	5d                   	pop    %ebp
  801f65:	c3                   	ret    
  801f66:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801f6d:	8d 76 00             	lea    0x0(%esi),%esi
  801f70:	29 fe                	sub    %edi,%esi
  801f72:	19 c3                	sbb    %eax,%ebx
  801f74:	89 f2                	mov    %esi,%edx
  801f76:	89 d9                	mov    %ebx,%ecx
  801f78:	e9 1d ff ff ff       	jmp    801e9a <__umoddi3+0x6a>
